This file contains 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 SimpleConfig | |
{ | |
node LAB-WEB01 | |
{ | |
File MarkerFile | |
{ | |
DestinationPath = 'C:\deployed.txt' | |
Contents = "" | |
Requires = "[Group]FooGroup","[Registry]EnableRdp" | |
} |
This file contains 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 SimpleConfig2 | |
{ | |
node LAB-WEB01 | |
{ | |
File MarkerFile | |
{ | |
DestinationPath = 'C:\deployed.txt' | |
Contents = "" | |
Requires = "[Group]FooGroup","[Registry]EnableRdp" | |
} |
This file contains 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
Script SetTimezone | |
{ | |
GetScript = { return @{ Timezone = ("{0}" -f (tzutil.exe /g)) } } | |
TestScript = { return (tzutil.exe /g) -ieq "GMT Standard Time" } | |
SetScript = { tzutil.exe /s "GMT Standard Time" } | |
} |
This file contains 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 DscSecurity | |
{ | |
node LAB-WEB01 | |
{ | |
ScriptEx UserInfo | |
{ | |
GetScript = { return $null } | |
TestScript = { | |
Write-Verbose ("ENV username: '{0}'" -f $env:USERNAME) | |
Write-Verbose ("Windows Identity: '{0}'" -f [System.Security.Principal.WindowsIdentity]::GetCurrent().Name) |
This file contains 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 DscSecurity | |
{ | |
node LAB-WEB01 | |
{ | |
Script UserInfo | |
{ | |
GetScript = { return $null } | |
TestScript = { | |
Write-Verbose ("ENV username: '{0}'" -f $env:USERNAME) | |
Write-Verbose ("Windows Identity: '{0}'" -f [System.Security.Principal.WindowsIdentity]::GetCurrent().Name) |
This file contains 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
$cred = Get-Credential | |
configuration DscSecurity | |
{ | |
node LAB-WEB01 | |
{ | |
Script UserInfo | |
{ | |
GetScript = { return $null } | |
TestScript = { |
This file contains 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 PullDemo | |
{ | |
Node Server01 | |
{ | |
Computer RenameServer01 | |
{ | |
Name = "NewHostName" | |
} | |
} | |
} |
This file contains 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 SetPullMode | |
{ | |
Node Server01 | |
{ | |
# Set the DSC engine (LCM) to Pull mode | |
DesiredStateConfigurationSettings LCM | |
{ | |
ConfigurationID = "e528dee8-6f0b-4885-98a1-1ee4d8e86d82" | |
ConfigurationMode = "Pull" | |
DownloadManagerName = "WebDownloadManager" |
This file contains 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 SetPullMode | |
{ | |
Node Server01 | |
{ | |
# Set the DSC engine (LCM) to Pull mode | |
LocalConfigurationManager | |
{ | |
ConfigurationID = "e528dee8-6f0b-4885-98a1-1ee4d8e86d82" | |
ConfigurationMode = "ApplyOnly" | |
RefreshMode = "Pull" |
This file contains 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
param | |
( | |
$resources = @(), | |
$pullServerRoot = "C:\ProgramData\PSDSCPullServer" | |
) | |
function New-Hash | |
{ | |
param | |
( |
OlderNewer