28-04-21 04:46 PM
Hi All,
I have created a Blueprism object to capture the response of PowerShell query which I am trying to execute from blueprism.
The code was running perfectly fine till I was running the Windows PowerShell commands. Now as I am trying to run few of the Quest PowerShell commands to get the Active Directory details for example Get-QADGroup or Get-QADUser the script fails with the below error.
Error - Could not load file or assembly 'System.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Code:
errorMessage="";
PowerShell ps = PowerShell.Create();
ps.Commands.AddScript(Input);
try{
Collection<PSObject> res = ps.Invoke();
string tex="";
foreach (var x in res)
{
tex=tex+"\n"+x;
}
output=tex;
if (ps.HadErrors)
{
foreach (ErrorRecord er in ps.Streams.Error)
{
errorMessage=er.Exception.Message;
}
}
}
catch (Exception e)
{
output="";
errorMessage=e.Message;
}
DLL used - System.dll
System.Data.dll
System.xml.dll
System.Drawing.dll
System.Collections.dll
System.Dynamic.dll
System.Core.dll
System.Linq.dll
Regards,
Vikash