Last active
November 5, 2017 22:55
-
-
Save gaelcolas/618c871d08d865bcb2bbc2327552b033 to your computer and use it in GitHub Desktop.
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
#Assuming you already have this hashtable | |
$MyHashes = @( | |
@{ | |
Ensure = 'Present' | |
Name = 'Putty' | |
Version = 'Latest' | |
ChocolateyOptions = @{ source = 'https://chocolatey.org/api/v2/' } | |
}, | |
@{ | |
Ensure = 'Absent' | |
Name = 'notepadplusplus' | |
} | |
) | |
. .\Get-DscSplattedResource.ps1 | |
Configuration MyDscConfig { | |
$Allnodes.nodename { | |
#The second Item will now work | |
foreach($MyHash in $MyHashes) { | |
# 'x' is an alias for my Get-DscSplattedResource function | |
x ChocolateyPackage $MyHash['name'] $MyHash | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment