Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
function Global:Get-DscSplattedResource {
# Remove Case Sensitivity of ordered Dictionary or Hashtables
$Properties = @{}+$Properties
$stringBuilder = [System.Text.StringBuilder]::new()
$null = $stringBuilder.AppendLine("Param([hashtable]`$Parameters)")
$null = $stringBuilder.AppendLine()
$null = $stringBuilder.AppendLine(" $ResourceName '$ExecutionName' { ")
foreach($PropertyName in $Properties.keys) {
$null = $stringBuilder.AppendLine("$PropertyName = `$(`$Parameters['$PropertyName'])")
$null = $stringBuilder.AppendLine("}")
Write-Debug ("Generated Resource Block = {0}" -f $stringBuilder.ToString())
if($NoInvoke) {
else {
Set-Alias -Name x -Value Get-DscSplattedResource -scope Global
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment