Last active
June 15, 2018 21:27
-
-
Save ryancbutler/877c9ae605a39a8e7d2bf2a6fd50dac0 to your computer and use it in GitHub Desktop.
bootstrap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
Enable-Psremoting -force -SkipNetworkProfileCheck | |
choco install -y git -params '"/GitOnlyOnPath"' | |
Install-PackageProvider -Name NuGet -Force | |
find-module -Repository PSGallery -Name PowerShellGet | Install-Module -Force | |
find-module -Repository PSGallery -Name PSScriptAnalyzer | Install-Module -Force | |
find-module -Repository PSGallery -Name Pester | Install-Module -Force -SkipPublisherCheck | |
Find-Module -Name xComputerManagement -Repository PSGallery | Install-Module -Force | |
Find-Module -Name xRemoteDesktopAdmin -Repository PSGallery | Install-Module -Force | |
Find-Module -Name xWinRm -Repository PSGallery | Install-Module -Force | |
$env:Path += ";$env:ProgramFiles\Git\cmd" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
configuration mdtnodomain { | |
Import-DscResource -ModuleName PsDesiredStateConfiguration | |
Import-DscResource -ModuleName xComputerManagement | |
Import-DscResource -ModuleName xRemoteDesktopAdmin | |
Import-DscResource -ModuleName xWinRM | |
node LOCALHOST { | |
xRemoteDesktopAdmin RemoteDesktopSettings | |
{ | |
Ensure = 'Present' | |
UserAuthentication = 'Secure' | |
} | |
xWinRM WinRMHTTPS | |
{ | |
Protocol = "HTTPS" | |
Ensure = "Present" | |
Service_AllowUnencrypted = 'false' | |
} | |
Script DisableDomainFirewall | |
{ | |
GetScript = { | |
@{ | |
GetScript = $GetScript | |
SetScript = $SetScript | |
TestScript = $TestScript | |
Result = -not('True' -in (Get-NetFirewallProfile -Name "Public").Enabled) | |
} | |
} | |
SetScript = { | |
Set-NetFirewallProfile -Name "Public" -Enabled False -Verbose | |
} | |
TestScript = { | |
$Status = -not('True' -in (Get-NetFirewallProfile -Name "Public").Enabled) | |
$Status -eq $True | |
} | |
} | |
Registry "DisableIPV6" #ResourceName | |
{ | |
Key = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters" | |
ValueName = "DisabledComponents" | |
ValueData = "255" | |
ValueType = "DWORD" | |
} | |
} | |
} | |
[DSCLocalConfigurationManager()] | |
configuration LCMConfig | |
{ | |
Node localhost | |
{ | |
Settings | |
{ | |
RebootNodeIfNeeded = $true | |
} | |
} | |
} | |
mdtnodomain | |
LCMConfig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Start-Transcript ("${env:SystemRoot}\Temp\DSC.log") | |
Set-DscLocalConfigurationManager -Path "C:\Windows\Temp\mdtnodomain\LCMConfig" -Verbose -Force | |
Start-DscConfiguration -Path "C:\Windows\Temp\mdtnodomain\mdtnodomain" -Verbose -Wait -Force | |
& "C:\Windows\Temp\mdtnodomain\CitrixOptimizer\CtxOptimizerEngine.ps1" -Source "C:\Windows\Temp\mdtnodomain\CitrixOptimizer\Templates\Citrix_Windows10_1803.xml" -Mode Execute -OutputXml "${env:SystemRoot}\Temp\ctxopt.xml" | |
Set-Item WSMan:\localhost\client\TrustedHosts -Value '*' -confirm:$false -Force | |
Start-DscConfiguration -Path "C:\Windows\Temp\mdtnodomain\mdtnodomain" -Verbose -Wait -Force | |
Stop-Transcript |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment