<?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: PowerShell function invoke/ call using C# code using Code stage in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/PowerShell-function-invoke-call-using-C-code-using-Code-stage/m-p/66009#M18614</link>
    <description>Hi &lt;A class="user-content-mention" data-sign="@" data-contactkey="ca424851-916f-4659-9083-f61b64c1ee05" data-tag-text="@Sivakumar TK" href="https://community.blueprism.com/network/profile?UserKey=ca424851-916f-4659-9083-f61b64c1ee05" data-itemmentionkey="8738b861-0727-4ba8-b5ab-c9fa3fd8f79c"&gt;@Sivakumar TK&lt;/A&gt;,&lt;BR /&gt;​&lt;BR /&gt;When you run the process in debug how are you setting the parameters vs when you run it from Control Room? Are they hardcoded in the process when you run it in debug?&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Eric Wilson&lt;BR /&gt;Director, Integrations and Enablement&lt;BR /&gt;Blue Prism Digital Exchange&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Mon, 13 Sep 2021 16:28:00 GMT</pubDate>
    <dc:creator>ewilson</dc:creator>
    <dc:date>2021-09-13T16:28:00Z</dc:date>
    <item>
      <title>PowerShell function invoke/ call using C# code using Code stage</title>
      <link>https://community.blueprism.com/t5/Product-Forum/PowerShell-function-invoke-call-using-C-code-using-Code-stage/m-p/66008#M18613</link>
      <description>Hi!&lt;BR /&gt;I am facing issues while running my process from control room. I have an object with a code stage where the the coding is done in C# which basically invokes/ executes/ call the PowerShell Module/ function that is in the machine database or pushed to the VDI. The codes runs perfectly fine when I run the process in debug mode (Process studio) however if I run the same code with same parameters, I get the following error. &lt;BR /&gt;&lt;BR /&gt;"Exception Details :The term 'UserList' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."&lt;BR /&gt;&lt;BR /&gt;This is on the same machine and with the same user so I assume it has nothing to do with the access. Can someone help me with the issue. Thanks!&lt;BR /&gt;&lt;BR /&gt;Parameters passed for the function is as follows:&amp;nbsp;&lt;BR /&gt;csvfile=C:\Temp\ADD_Users\Input_File_Add_Users\Input_File_Add_Users_20210909.csv,Name=Previous,csvariable=DL_Name,LogLocation=C:\Temp\ADD_Users&lt;BR /&gt;&lt;BR /&gt;Module and function name is as follows:&lt;BR /&gt;userlist&lt;BR /&gt;&lt;BR /&gt;This is the same value to the code stage while running from Process studio and also from control room (Retrieved from Logs).&lt;BR /&gt;&lt;BR /&gt;Any help here would be great help. Thanks!&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Sivakumar TK&lt;BR /&gt;Sr. Software Developer&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Sep 2021 17:33:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/PowerShell-function-invoke-call-using-C-code-using-Code-stage/m-p/66008#M18613</guid>
      <dc:creator>SivakumarTK</dc:creator>
      <dc:date>2021-09-09T17:33:00Z</dc:date>
    </item>
    <item>
      <title>RE: PowerShell function invoke/ call using C# code using Code stage</title>
      <link>https://community.blueprism.com/t5/Product-Forum/PowerShell-function-invoke-call-using-C-code-using-Code-stage/m-p/66009#M18614</link>
      <description>Hi &lt;A class="user-content-mention" data-sign="@" data-contactkey="ca424851-916f-4659-9083-f61b64c1ee05" data-tag-text="@Sivakumar TK" href="https://community.blueprism.com/network/profile?UserKey=ca424851-916f-4659-9083-f61b64c1ee05" data-itemmentionkey="8738b861-0727-4ba8-b5ab-c9fa3fd8f79c"&gt;@Sivakumar TK&lt;/A&gt;,&lt;BR /&gt;​&lt;BR /&gt;When you run the process in debug how are you setting the parameters vs when you run it from Control Room? Are they hardcoded in the process when you run it in debug?&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Eric Wilson&lt;BR /&gt;Director, Integrations and Enablement&lt;BR /&gt;Blue Prism Digital Exchange&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Sep 2021 16:28:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/PowerShell-function-invoke-call-using-C-code-using-Code-stage/m-p/66009#M18614</guid>
      <dc:creator>ewilson</dc:creator>
      <dc:date>2021-09-13T16:28:00Z</dc:date>
    </item>
    <item>
      <title>RE: PowerShell function invoke/ call using C# code using Code stage</title>
      <link>https://community.blueprism.com/t5/Product-Forum/PowerShell-function-invoke-call-using-C-code-using-Code-stage/m-p/66010#M18615</link>
      <description>Hi Eric, &lt;BR /&gt;Appreciate for taking time and looking into this.&lt;BR /&gt;&lt;BR /&gt;The parameters are as below passed to the object.&lt;BR /&gt;"csvfile="&amp;amp;[Add Users_Input File Name &amp;amp; Path]&amp;amp;".csv,Name=Previous,csvariable=DL_Name,LogLocation=C:\Temp\ADD_Users"&lt;BR /&gt;&lt;BR /&gt;These data items values would be below.&lt;BR /&gt;&lt;SPAN&gt;csvfile=C:\Temp\ADD_Users\Input_File_Add_Users\Input_File_Add_Users_20210909.csv,Name=Previous,csvariable=DL_Name,LogLocation=C:\Temp\ADD_Users&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Basically depending on the items from Queue these values get set.&lt;BR /&gt;&lt;BR /&gt;I tried same items after force retry in Queue so the result/ parameter (data items) values passed is same.&lt;BR /&gt;It worked in debug&amp;nbsp; mode but errored if run in control room. Error is given below.&lt;BR /&gt;&lt;SPAN&gt;"Exception Details :The term 'UserList' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Sivakumar TK&lt;BR /&gt;Sr. Software Developer&lt;BR /&gt;PPD&lt;BR /&gt;Asia/Kolkata&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Sep 2021 09:48:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/PowerShell-function-invoke-call-using-C-code-using-Code-stage/m-p/66010#M18615</guid>
      <dc:creator>SivakumarTK</dc:creator>
      <dc:date>2021-09-14T09:48:00Z</dc:date>
    </item>
    <item>
      <title>RE: PowerShell function invoke/ call using C# code using Code stage</title>
      <link>https://community.blueprism.com/t5/Product-Forum/PowerShell-function-invoke-call-using-C-code-using-Code-stage/m-p/66011#M18616</link>
      <description>&lt;A class="user-content-mention" data-sign="@" data-contactkey="ca424851-916f-4659-9083-f61b64c1ee05" data-tag-text="@Sivakumar TK" href="https://community.blueprism.com/network/profile?UserKey=ca424851-916f-4659-9083-f61b64c1ee05" data-itemmentionkey="9703d128-caf8-4231-9816-895ea7dd3600"&gt;@Sivakumar TK&lt;/A&gt;,&lt;BR /&gt;&lt;BR /&gt;It doesn't seem like the variables are the issue as much as the actual command reference. I assume 'UserList' is the name of the PowerShell script/cmdlet you're trying to run? When you run this from Control Room are you running it against a runtime resource on the same machine as you are debugging on? &lt;BR /&gt;&lt;BR /&gt;From what I can see in a few Microsoft articles this error usually implies the associated PowerShell module isn't available for some reason. Is this a custom PowerShell script you wrote? Can you share your actual C# code?&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, Integrations and Enablement&lt;BR /&gt;Blue Prism Digital Exchange&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Sep 2021 13:59:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/PowerShell-function-invoke-call-using-C-code-using-Code-stage/m-p/66011#M18616</guid>
      <dc:creator>ewilson</dc:creator>
      <dc:date>2021-09-14T13:59:00Z</dc:date>
    </item>
  </channel>
</rss>

