Forum Discussion
SBVRaja
Aug 04, 2021Copper Contributor
Alternative to invoke-expression
I am looking for alternate way to extract the value of the below powershell object without using invoke-expression
invoke-expression "`$abc.properties.$subprop"
or
invoke-expression "`$abc.$subprop1"
Where
$abc is a powershell object in JSON format
$subprop is having one of the Noteproperties of '$abc.properties'
- SBVRajaCopper ContributorIf the expression is a script cmdlet & $variable format might have worked. But in this case, it is not working.