Created
September 13, 2017 14:39
-
-
Save ukcoderj/397b615872da64e0bc3338e5326ee652 to your computer and use it in GitHub Desktop.
How to create a nested variable in powershell
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
# How to create a nested variable in powershell | |
Clear-Host | |
$NestedObject1 = [pscustomobject]@{Item1="Bob";Item2="Fred";Item3="Joe"} | |
$ParentObject = [pscustomobject]@{LevelA=[pscustomobject]@{LevelB=@($NestedObject1)}} | |
#let's check it | |
$parentObject.LevelA.LevelB[0].Item2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment