I need to use an assembly in a start script in JEA (Just Enough Administration) but I get an error message when trying to use it.
The capabilities files contains
AssembliesToLoad = 'Web.Script.Serialization.JavaScriptSerializer'
But when I try to use it in a script
$parser = New-Object Web.Script.Serialization.JavaScriptSerializer
I get the error
Enter-PsSession : Could not load file or assembly
'Web.Script.Serialization.JavaScriptSerializer' or one
of its dependencies. The system cannot find the file specified.
At least for Windows PowerShell 5.1, the
JavaScriptSerializerClass is part ofSystem.Web.Extensions.dll, there is no suchWeb.Script.Serialization.JavaScriptSerializerassembly, in fact:Will throw an error, however:
So fixing your issue might be as simple as: