<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic RE: VBO to Invoke PowerShell Files in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47712#M3398</link>
    <description>Hello &lt;A class="user-content-mention" data-sign="@" data-contactkey="b8926dc9-0781-4bb7-a0a0-d58aa97139db" data-tag-text="@Rushabh Dedhia" href="https://community.blueprism.com/network/profile?UserKey=b8926dc9-0781-4bb7-a0a0-d58aa97139db" data-itemmentionkey="0927076e-86b7-41bf-9947-bfb8855b4174"&gt;@Rushabh Dedhia&lt;/A&gt;,&lt;BR /&gt;thank you very much, excellent.&lt;BR /&gt;Best regards&lt;BR /&gt;Stefan​​&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Stefan Schnell&lt;BR /&gt;Senior Systems Engineer at BWI GmbH&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Sat, 26 Nov 2022 16:29:00 GMT</pubDate>
    <dc:creator>StefanSchnell</dc:creator>
    <dc:date>2022-11-26T16:29:00Z</dc:date>
    <item>
      <title>VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47679#M3365</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;
&lt;P&gt;these days I tried to build my first own VBO. I thought a Code Stage that executes a PowerShell script might be a good example. So I developed a small routine that reads and executes a PowerShell script. It also offers the possibility to pass parameters to the script. Here the code:&lt;/P&gt;
&lt;PRE class="language-csharp"&gt;&lt;CODE&gt;//-Begin----------------------------------------------------------------

//-Initialization of output variables-----------------------------------
ErrorMessage = "";
Result = "";

//-Check if file exists-------------------------------------------------
if(!File.Exists(PowerShellFileName)) {
  ErrorMessage = "File not found";
  return;
}

//-Read the content of the file and check-------------------------------
string PSCode = File.ReadAllText(PowerShellFileName);
if(System.String.IsNullOrEmpty(PSCode)) {
  ErrorMessage = "Code missed";
  return;
}

//-Checking the Separator-----------------------------------------------
if(System.String.IsNullOrEmpty(Separator)) {
  Separator = ",";
}

//-Read parameters and add it to a list---------------------------------
object[] Params = null;
if(!System.String.IsNullOrEmpty(Parameters)) {
  string[] partsParam = Parameters.Split(new char[] {Separator[0]});
  Params = new List&amp;lt;string&amp;gt;(partsParam).ToArray();
}

//-Open the runspace----------------------------------------------------
Runspace runspace;

try {

  runspace = RunspaceFactory.CreateRunspace();
  if(STA == true) {
    runspace.ApartmentState = System.Threading.ApartmentState.STA;
  } else {
    runspace.ApartmentState = System.Threading.ApartmentState.MTA;
  }
  runspace.ThreadOptions = PSThreadOptions.ReuseThread;
  runspace.Open();

} catch(System.Exception ex) {
  ErrorMessage = ex.Message;
  return;
}

//-Create PowerShell----------------------------------------------------
System.Management.Automation.PowerShell PS;

try {

  PS = System.Management.Automation.PowerShell.Create();
  PS.Runspace = runspace;
  PS.AddScript(PSCode);

} catch(System.Exception ex) {
  runspace.Close();
  ErrorMessage = ex.Message;
  return;
}

//-Add parameters to PowerShell-----------------------------------------
if(Params != null) {
  foreach(string PSParam in Params) {
    string[] partsPSParam = PSParam.Split('=');
    PS.AddParameter(partsPSParam[0].Trim(), partsPSParam[1].Trim());
  }
}

//-Invoke PowerShell----------------------------------------------------
try {

  Collection&amp;lt;PSObject&amp;gt; Ret = PS.Invoke();
  runspace.Close();

  //-Set Result---------------------------------------------------------
  StringBuilder stringBuilder = new StringBuilder();
  foreach(PSObject oPS in Ret) {
    stringBuilder.AppendLine(oPS.ToString());
  }
  Result = stringBuilder.ToString();

} catch(System.Exception ex) {
  runspace.Close();
  ErrorMessage = ex.Message;
  return;
}

//-End------------------------------------------------------------------&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are the input parameters&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;PowerShellFileName = Path and name of the PowerShell script &lt;SPAN&gt;which should be executed.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;Parameters = Parameters of the PowerShell script, if available.&lt;/LI&gt;
&lt;LI&gt;Separator = The separator between the parameters, default is a comma.&lt;/LI&gt;
&lt;LI&gt;STA = S&lt;SPAN&gt;ingle-Threaded Apartment if true, Multi Threaded Apartment if false, default is true.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;There are the output parameters&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Result = Output of the PowerShell script.&lt;/LI&gt;
&lt;LI&gt;ErrorMessage = In case of error an explanatory text.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P class="media" style="overflow: hidden; zoom: 1;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="12672.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/12840i60A694523ED88241/image-size/large?v=v2&amp;amp;px=999" role="button" title="12672.png" alt="12672.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;To test it I use this PowerShell script example, with a few parameters and an output:&lt;/P&gt;
&lt;PRE class="language-csharp"&gt;&lt;CODE&gt;#-Begin-----------------------------------------------------------------

Param (
  [String]$var1,
  [String]$var2,
  [String]$desc,
  [Int]$i
)

$varHost = Get-Host;

$Ret = $Null;
For($j = 1; $j -le $i; $j++) {
  $Ret += "PowerShell greets " + $j + "`r`n";
}
$Ret += "Hello World via " + $var1 + " version " + $var2 + " from ";
$Ret += $varHost.Name + " " + $varHost.Version + "`r`n";
$Ret += $desc;
$Ret | Out-String;

#-End-------------------------------------------------------------------&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P class="media" style="overflow: hidden; zoom: 1;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="12673.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/12842i800D6EA555EF3912/image-size/large?v=v2&amp;amp;px=999" role="button" title="12673.png" alt="12673.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;It works as expected. As far as I can see, this should make it easier to integrate PowerShell into Blue Prism processes. Since the basis is available with Windows, this approach should be executable without additional installations. In some cases, such integration can be very profitable, for example if consolidated scripts already exist and can be further used.&lt;/P&gt;
&lt;P&gt;Best regards&lt;BR /&gt;Stefan&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Stefan Schnell&lt;BR /&gt;Senior Systems Engineer at BWI GmbH&lt;BR /&gt;------------------------------&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Dec 2020 04:35:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47679#M3365</guid>
      <dc:creator>StefanSchnell</dc:creator>
      <dc:date>2020-12-27T04:35:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47680#M3366</link>
      <description>&lt;P&gt;Great &amp;nbsp;&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/38903"&gt;@StefanSchnell&lt;/a&gt; for making a useful utility.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Ritansh Jatwani&lt;BR /&gt;Consultant&lt;BR /&gt;EY&lt;BR /&gt;Gurgaon&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Dec 2020 13:40:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47680#M3366</guid>
      <dc:creator>ritansh.jatwani</dc:creator>
      <dc:date>2020-12-28T13:40:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47681#M3367</link>
      <description>Hello Community,&lt;BR /&gt;I have modified the code of the VBO a little bit to make it possible to store the PowerShell code inside the object. Now it is possible to select whether the PowerShell code should be loaded from an external file &lt;SPAN&gt;or if the code is passed.&lt;BR /&gt;&lt;/SPAN&gt;Best regards&lt;BR /&gt;Stefan&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE class="language-csharp"&gt;&lt;CODE&gt;//-Begin----------------------------------------------------------------

//-Initialization of output variables-----------------------------------
ErrorMessage = "";
Result = "";
string PSCode = "";

if(System.String.IsNullOrEmpty(PowerShellFileName)) {
  PSCode = PowerShellCode;
} else {
  //-Check if file exists-----------------------------------------------
  if(!File.Exists(PowerShellFileName)) {
    ErrorMessage = "File not found";
    return;
  }
  //-Read the content of the file---------------------------------------
  PSCode = File.ReadAllText(PowerShellFileName);
}

//-Check if code is available-------------------------------------------
if(System.String.IsNullOrEmpty(PSCode)) {
  ErrorMessage = "Code missed";
  return;
}

//-Checking the Separator-----------------------------------------------
if(System.String.IsNullOrEmpty(Separator)) {
  Separator = ",";
}

//-Read parameters and add it to a list---------------------------------
object[] Params = null;
if(!System.String.IsNullOrEmpty(Parameters)) {
  string[] partsParam = Parameters.Split(new char[] {Separator[0]});
  Params = new List&amp;lt;string&amp;gt;(partsParam).ToArray();
}

//-Open the runspace----------------------------------------------------
Runspace runspace;

try {

  runspace = RunspaceFactory.CreateRunspace();
  if(STA == true) {
    runspace.ApartmentState = System.Threading.ApartmentState.STA;
  } else {
    runspace.ApartmentState = System.Threading.ApartmentState.MTA;
  }
  runspace.ThreadOptions = PSThreadOptions.ReuseThread;
  runspace.Open();

} catch(System.Exception ex) {
  ErrorMessage = ex.Message;
  return;
}

//-Create PowerShell----------------------------------------------------
System.Management.Automation.PowerShell PS;

try {

  PS = System.Management.Automation.PowerShell.Create();
  PS.Runspace = runspace;
  PS.AddScript(PSCode);

} catch(System.Exception ex) {
  runspace.Close();
  ErrorMessage = ex.Message;
  return;
}

//-Add parameters to PowerShell-----------------------------------------
if(Params != null) {
  foreach(string PSParam in Params) {
    string[] partsPSParam = PSParam.Split('=');
    PS.AddParameter(partsPSParam[0].Trim(), partsPSParam[1].Trim());
  }
}

//-Invoke PowerShell----------------------------------------------------
try {

  Collection&amp;lt;PSObject&amp;gt; Ret = PS.Invoke();
  runspace.Close();

  //-Set Result---------------------------------------------------------
  StringBuilder stringBuilder = new StringBuilder();
  foreach(PSObject oPS in Ret) {
    stringBuilder.AppendLine(oPS.ToString());
  }
  Result = stringBuilder.ToString();

} catch(System.Exception ex) {
  runspace.Close();
  ErrorMessage = ex.Message;
  return;
}

//-End------------------------------------------------------------------
​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BR /&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="12426.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/12596iBC74117F1AC52611/image-size/large?v=v2&amp;amp;px=999" role="button" title="12426.png" alt="12426.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Stefan Schnell&lt;BR /&gt;Senior Systems Engineer at BWI GmbH&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Jan 2021 07:04:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47681#M3367</guid>
      <dc:creator>StefanSchnell</dc:creator>
      <dc:date>2021-01-05T07:04:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47682#M3368</link>
      <description>&lt;P&gt;Hey Stefan, really good job on this.&lt;/P&gt;
&lt;P&gt;This allows for a lot of possibilities, triggering schedules on other resources is what I´m most excited for.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Atli Harðarson&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Jan 2021 22:00:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47682#M3368</guid>
      <dc:creator>AtliHarðarson</dc:creator>
      <dc:date>2021-01-07T22:00:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47683#M3369</link>
      <description>Hello Atli,&lt;BR /&gt;&lt;BR /&gt;thank you very much.&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Stefan&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Stefan Schnell&lt;BR /&gt;Senior Systems Engineer at BWI GmbH&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jan 2021 05:59:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47683#M3369</guid>
      <dc:creator>StefanSchnell</dc:creator>
      <dc:date>2021-01-08T05:59:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47684#M3370</link>
      <description>Hello Community,&lt;BR /&gt;here a slightly extended version.&lt;BR /&gt;Best regards&lt;BR /&gt;Stefan&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Stefan Schnell&lt;BR /&gt;Senior Systems Engineer at BWI GmbH&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jan 2021 06:02:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47684#M3370</guid>
      <dc:creator>StefanSchnell</dc:creator>
      <dc:date>2021-01-08T06:02:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47685#M3371</link>
      <description>Hi Stefan,&lt;BR /&gt;Have you considered submitting this as an asset on the Blue Prism Digital Exchange?&lt;BR /&gt;You can do this by going to the DX (https://digitalexchange.blueprism.com/) and clicking My Account -&amp;gt; Submit Asset.&lt;BR /&gt;&lt;A data-tag-text="DigitalExchange" data-sign="#" class="user-content-hashtag" href="https://community.blueprism.com/search?s=tags%3A%22Digital Exchange%22&amp;amp;executesearch=true" data-tag-key="d791531b-453b-490d-9117-b5a6c6d2ba82"&gt;#DigitalExchange&lt;/A&gt;​&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Patrick Aucoin&lt;BR /&gt;Senior Product Consultant&lt;BR /&gt;Blue Prism&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jan 2021 13:55:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47685#M3371</guid>
      <dc:creator>PatrickAucoin</dc:creator>
      <dc:date>2021-01-08T13:55:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47686#M3372</link>
      <description>&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/453"&gt;@PatrickAucoin&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;Hello Patrick,&lt;BR /&gt;thanks for your reply.&lt;BR /&gt;No, I haven't even thought of that yet, but it is my pleasure to do that. Thank you very much for your hint.&lt;BR /&gt;Best regards&lt;BR /&gt;Stefan&lt;BR /&gt;&lt;BR /&gt;​&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Stefan Schnell&lt;BR /&gt;Senior Systems Engineer at BWI GmbH&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jan 2021 14:59:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47686#M3372</guid>
      <dc:creator>StefanSchnell</dc:creator>
      <dc:date>2021-01-08T14:59:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47687#M3373</link>
      <description>&lt;P&gt;Hi Stefan&lt;/P&gt;
&lt;P&gt;Thanks for your fantastic job on this. &lt;SPAN lang="en"&gt;I really appreciate it&lt;/SPAN&gt;. ​&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Pia van Acker&lt;BR /&gt;Digitaliseringskonsulent&lt;BR /&gt;Gladsaxe Commune&lt;BR /&gt;Europe/Copenhagen&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Feb 2021 09:24:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47687#M3373</guid>
      <dc:creator>Piavan_Acker</dc:creator>
      <dc:date>2021-02-18T09:24:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47688#M3374</link>
      <description>Hello Pia,&lt;BR /&gt;&lt;BR /&gt;thank you very much.&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Stefan&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Stefan Schnell&lt;BR /&gt;Senior Systems Engineer at BWI GmbH&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Feb 2021 05:55:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47688#M3374</guid>
      <dc:creator>StefanSchnell</dc:creator>
      <dc:date>2021-02-19T05:55:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47689#M3375</link>
      <description>This looks great!&lt;BR /&gt;&lt;BR /&gt;I'm having an issue though... If I run a script manually it works. I run it via this VBO and it gives me an error.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The error is it cannot see a set of registry keys, if I check manually it works. Does PowerShell need to be run with elevated permissions?&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Mat Hanley&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Mar 2021 12:32:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47689#M3375</guid>
      <dc:creator>Mat</dc:creator>
      <dc:date>2021-03-05T12:32:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47690#M3376</link>
      <description>&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;I think it might be a limitation (or security feature) of how PowerShell works when another application invokes it? This is the message I get when I try to open powershell with a script manually using&amp;nbsp; "Run Process" action with the input of opening a script I created.&lt;/DIV&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;&lt;/DIV&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;It's the same error I get if I run the script file or just the script text from your utility but I think it clips the rest of the error when it stores the result.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="12532.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/12707i93C56009D1C6015D/image-size/large?v=v2&amp;amp;px=999" role="button" title="12532.png" alt="12532.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Mat&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Mar 2021 15:27:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47690#M3376</guid>
      <dc:creator>Mat</dc:creator>
      <dc:date>2021-03-05T15:27:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47691#M3377</link>
      <description>&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/38995"&gt;@Mat&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;Hello Mat,&lt;BR /&gt;&lt;BR /&gt;thanks​ for your reply.&lt;BR /&gt;&lt;BR /&gt;As far as I know PowerShell needs no elevated permissions.&lt;BR /&gt;&lt;BR /&gt;I assume you have different execution policies for the scopes:&lt;BR /&gt;
&lt;DIV class="media" style="overflow: hidden;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="12536.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/12702i7BAD241BC2A6C287/image-size/large?v=v2&amp;amp;px=999" role="button" title="12536.png" alt="12536.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;BR /&gt;You can find &lt;A href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-5.1" target="_blank" rel="noopener"&gt;more information about execution policies of PowerShell&lt;/A&gt; here.&lt;BR /&gt;This could be a possible reason.&lt;BR /&gt;&lt;BR /&gt;I tried different settings but in my case all works well without any differences.&lt;BR /&gt;Let us know your execution policy settings.&lt;BR /&gt;&lt;BR /&gt;Addition:&lt;BR /&gt;Interesting is after I set the the execution policy of the scopes Process, CurrentUser and LocalMachine to Restricted the BP VBO works, but the process not.&lt;BR /&gt;&lt;BR /&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="12537.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/12703iD056676504D335DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="12537.png" alt="12537.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="12538.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/12706i31E4E105F1CD3294/image-size/large?v=v2&amp;amp;px=999" role="button" title="12538.png" alt="12538.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;It seems that the PowerShell Automation object works independently from the execution policies of the scopes. So this would no longer be a possible reason.&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Stefan&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Stefan Schnell&lt;BR /&gt;Senior Systems Engineer at BWI GmbH&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 12 Mar 2021 05:58:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47691#M3377</guid>
      <dc:creator>StefanSchnell</dc:creator>
      <dc:date>2021-03-12T05:58:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47692#M3378</link>
      <description>&lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/38903"&gt;@StefanSchnell&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;So, my execution policies are the same as yours. That doesn't seem to be the issue. &lt;BR /&gt;&lt;BR /&gt;I have a colleague at work trying to help me with this.&amp;nbsp; We've not 'cracked' it yet. &lt;BR /&gt;&lt;BR /&gt;I was hoping to use the Powershell module Smlets ( &lt;A href="https://github.com/SMLets/SMLets" target="test_blank"&gt;https://github.com/SMLets/SMLets&lt;/A&gt; ) in order to log jobs (create a ticket / incident) in Service Manager on behalf of the virtual worker. For example if an automation failed I wanted it to log an incident in Microsoft ​System Center Service Manager rather than sending an email.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I've managed to create an incident using a powershell script if I run it manually. If I run it via the virtual worker using your VBO it errors.&amp;nbsp; Es ist sehr komisch!!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm pretty new to powershell, and I only started working with Blue Prism in July. This VBO you've built though looks great I think it will be very useful to run PS scripts in the future too.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Mat&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Mar 2021 15:57:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47692#M3378</guid>
      <dc:creator>Mat</dc:creator>
      <dc:date>2021-03-16T15:57:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47693#M3379</link>
      <description>Hi Stefan,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am getting the same error message when I have created a Blueprism object to execute a PowerShell command and capture the response. The process is running fine when I am trying to execute commands like Get-ADGroup, Get-Acl but it fail with the above error when I am executing the command as Get-QADGroup(Quest Commands for AD)etc.&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;errorMessage="";&lt;BR /&gt;PowerShell ps = PowerShell.Create();&lt;BR /&gt;&amp;nbsp;ps.Commands.AddScript(Input);&lt;BR /&gt;&amp;nbsp;try{&lt;BR /&gt;Collection&amp;lt;PSObject&amp;gt; res = ps.Invoke();&lt;BR /&gt;&amp;nbsp;string tex="";&lt;BR /&gt;foreach (var x in res)&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;tex=tex+"\n"+x;&lt;BR /&gt;}&lt;BR /&gt;output=tex;&lt;BR /&gt;&lt;BR /&gt;if (ps.HadErrors)&lt;BR /&gt;{&lt;BR /&gt;foreach (ErrorRecord er in ps.Streams.Error)&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;errorMessage=er.Exception.Message;&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;catch (Exception e)&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp;output="";&lt;BR /&gt;&amp;nbsp;errorMessage=e.Message; &lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;&lt;BR /&gt;DLL used - System.dll&lt;BR /&gt;System.Data.dll&lt;BR /&gt;System.xml.dll&lt;BR /&gt;System.Drawing.dll&lt;BR /&gt;System.Collections.dll&lt;BR /&gt;System.Dynamic.dll&lt;BR /&gt;System.Core.dll&lt;BR /&gt;System.Linq.dll&lt;BR /&gt;&lt;BR /&gt;Kindly let me know if you have any thought on this.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Vikash&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Vikash Anand&lt;BR /&gt;Senior Software Engineer&lt;BR /&gt;Ernst and Young&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Apr 2021 15:32:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47693#M3379</guid>
      <dc:creator>Vikash011</dc:creator>
      <dc:date>2021-04-28T15:32:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47694#M3380</link>
      <description>Hi Stefan,&lt;BR /&gt;&lt;BR /&gt;Does this VBO also works with the Quest PowerShell? I can see it does not capture the response and still continue to the successful path whereas when I run the script directly in PowerShell it works as expected and return the output.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Vikash&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Vikash Anand&lt;BR /&gt;Senior Software Engineer&lt;BR /&gt;Ernst and Young&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Apr 2021 09:11:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47694#M3380</guid>
      <dc:creator>Vikash011</dc:creator>
      <dc:date>2021-04-29T09:11:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47695#M3381</link>
      <description>&lt;A class="user-content-mention" data-sign="@" data-contactkey="ca37420e-034d-4699-85b9-a22be23951a2" data-tag-text="@Vikash Anand" href="https://community.blueprism.com/network/profile?UserKey=ca37420e-034d-4699-85b9-a22be23951a2" data-itemmentionkey="f526e850-4eee-4b53-91de-1aadcf35f70e"&gt;@Vikash Anand&lt;/A&gt;,&lt;BR /&gt;&lt;BR /&gt;Are you talking about the packaged &lt;STRONG&gt;cmdlets&lt;/STRONG&gt; Quest released that were subsequently purchased by Dell? As far as I know, Quest never built their own PowerShell.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;​&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Eric Wilson&lt;BR /&gt;Director, Partner Integrations for Digital Exchange&lt;BR /&gt;Blue Prism&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Apr 2021 17:54:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47695#M3381</guid>
      <dc:creator>ewilson</dc:creator>
      <dc:date>2021-04-30T17:54:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47696#M3382</link>
      <description>&lt;A class="user-content-mention" data-sign="@" data-contactkey="ca37420e-034d-4699-85b9-a22be23951a2" data-tag-text="@Vikash Anand" href="https://community.blueprism.com/network/profile?UserKey=ca37420e-034d-4699-85b9-a22be23951a2" data-itemmentionkey="762a8d93-6bc0-4326-a023-4c15c468594b"&gt;@Vikash Anand&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hello Vikash,&lt;BR /&gt;thanks for your message.&lt;BR /&gt;Sorry but I can't answer your question. The last free release of Quest ActiveDirectory Cmdlets for PowerShell I found &lt;A href="https://www.powershelladmin.com/wiki/Quest_ActiveRoles_Management_Shell_Download" target="_blank" rel="noopener"&gt;here&lt;/A&gt; is 1.5.1 from 2012 and it needs dotNET framework 3.5. As far as I read &lt;A href="https://ss64.com/ps/quest.html" target="_blank" rel="noopener"&gt;here&lt;/A&gt; are these Cmdlets deprecated and not longer available. If your requirements can be met with the Active Directory (AD) modules of Microsoft's RSAT (Remote Server Administration Tools), then you should use that.&lt;BR /&gt;Best regards&lt;BR /&gt;Stefan&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Stefan Schnell&lt;BR /&gt;Senior Systems Engineer at BWI GmbH&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Sat, 01 May 2021 15:28:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47696#M3382</guid>
      <dc:creator>StefanSchnell</dc:creator>
      <dc:date>2021-05-01T15:28:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47697#M3383</link>
      <description>Hi Stefan,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Great work. And thank you for sharing.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;Ben&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Benjamin Anderson,&lt;BR /&gt;Senior Consultant,&lt;BR /&gt;UK&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Sat, 01 May 2021 22:31:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47697#M3383</guid>
      <dc:creator>BenAnderson</dc:creator>
      <dc:date>2021-05-01T22:31:00Z</dc:date>
    </item>
    <item>
      <title>RE: VBO to Invoke PowerShell Files</title>
      <link>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47698#M3384</link>
      <description>Hello Ben,&lt;BR /&gt;&lt;BR /&gt;thank you very much.&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Stefan&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Stefan Schnell&lt;BR /&gt;Senior Systems Engineer at BWI GmbH&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Sun, 02 May 2021 02:46:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/VBO-to-Invoke-PowerShell-Files/m-p/47698#M3384</guid>
      <dc:creator>StefanSchnell</dc:creator>
      <dc:date>2021-05-02T02:46:00Z</dc:date>
    </item>
  </channel>
</rss>

