Skip to content

Instantly share code, notes, and snippets.

@johnayoung
Created November 27, 2018 21:11
Show Gist options
  • Save johnayoung/036860f001d6f85c7ae54ce635b1e724 to your computer and use it in GitHub Desktop.
Save johnayoung/036860f001d6f85c7ae54ce635b1e724 to your computer and use it in GitHub Desktop.
#Convert JSON file to an object
$JsonParameters = ConvertFrom-Json -InputObject $content
#Create new PSObject with no properties
$oData = New-Object PSObject
#Loop through properties of the $JsonParameters.parameters object, and add them to the new blank object
$JsonParameters.parameters.psobject.Properties.Name |
ForEach{
Add-Member -InputObject $oData -NotePropertyName $_ -NotePropertyValue $JsonParameters.parameters.$_.Value
}
$oData
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment