Alternative to invoke-expression

Occasional Contributor

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'

 

1 Reply
If the expression is a script cmdlet & $variable format might have worked. But in this case, it is not working.