You are not logged in.
I have a xml file where i have defined some HashTable variables, when i read the content at runtime they should be resolved.
<variable>
<clientname>$($hfinfo.hf)</clientname>
</variable>
It was working in the Powershell 2.0, the snippet is below.
PowerShell 2.0
--------------------
$hash=@{};
$hash.add("hf","HFDetail_Random_Name")
[xml]$xmlcontent=[xml]($ExecutionContext.InvokeCommand.ExpandString((Get-Content ($xmlFilePath))))
In powershell 4.0, when i execute the same command i am getting the error
Exception calling "ExpandString" with "1" argument(s): "Object reference not set to an instance of an object."
Thanks,
Harsha
Offline