Created
February 10, 2020 07:01
-
-
Save bateskevin/ad7640d3ce95b8bbeb87dc3e1dd2014d to your computer and use it in GitHub Desktop.
Demo code for splatting problem
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
$SplatParam = @() | |
$Param1 = @{} | |
$Properties1 = @{} | |
$Properties1.ValueName = "EnumerateAdministrators" | |
$Properties1.Key = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI\EnumerateAdministrators" | |
$Properties1.ValueType = "Dword" | |
$Properties1.ValueData = 0 | |
$Param1.Name = "Registry" | |
$Param1.Method = "Test" | |
$Param1.Property = $Properties1 | |
$SplatParam += $Param1 | |
$Param2 = @{} | |
$Properties2 = @{} | |
$Properties2.ValueName = "NoAutorun" | |
$Properties2.Key = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoAutorun" | |
$Properties2.ValueType = "Dword" | |
$Properties2.ValueData = 1 | |
$Param2.Name = "Registry" | |
$Param2.Method = "Test" | |
$Param2.Property = $Properties2 | |
$SplatParam += $Param2 | |
$SplatParam | Foreach-Object -Parallel { | |
Invoke-DscResource @_ | |
} -Throttlelimit 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment