Since ConvertFrom-Json was introduced in Powershell 3.0, make sure your environment is also Powershell 3.0+. You can do this by running $Host.Version in the context of your C # code and looking at the returned Version object. It must have a major version of 3 or 4.
If it is 3.0+ because ConvertFrom-Json is enabled through the Microsoft.PowerShell.Utility module, make sure the module is loaded by running the Import-Module Microsoft.PowerShell.Utility in front of your ConvertFrom-Json. The module is probably loaded via normal session initialization scripts, but when executed from code, it may not be executed.
Highlyunavailable
source share