<?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 Passing command/arguments to Run command tool - Powershell script in Alteryx Server Discussions</title>
    <link>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/749825#M8718</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a windows powershell script. In command prompt, I pass filepath and filename as input parameters at run time and the script runs perfectly fine. File name is called Refresh_File.ps1. Here is the command I run&amp;nbsp;&lt;/P&gt;&lt;P&gt;powershell -file Refresh_File.ps1 -&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;filepath "C:\Users\xxxxx\Documents\Output\ProcessedFile_0420.xlsx"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to pass these the highlighted arguments in alteryx at run time by using Run command tool.&amp;nbsp; This process will be promoted to the alteryx server so looking for a solution that will work in alteryx server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Nikita&lt;/P&gt;</description>
    <pubDate>Wed, 21 Apr 2021 20:00:13 GMT</pubDate>
    <dc:creator>Nikita-Puniani</dc:creator>
    <dc:date>2021-04-21T20:00:13Z</dc:date>
    <item>
      <title>Passing command/arguments to Run command tool - Powershell script</title>
      <link>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/749825#M8718</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a windows powershell script. In command prompt, I pass filepath and filename as input parameters at run time and the script runs perfectly fine. File name is called Refresh_File.ps1. Here is the command I run&amp;nbsp;&lt;/P&gt;&lt;P&gt;powershell -file Refresh_File.ps1 -&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;filepath "C:\Users\xxxxx\Documents\Output\ProcessedFile_0420.xlsx"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to pass these the highlighted arguments in alteryx at run time by using Run command tool.&amp;nbsp; This process will be promoted to the alteryx server so looking for a solution that will work in alteryx server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Nikita&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 20:00:13 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/749825#M8718</guid>
      <dc:creator>Nikita-Puniani</dc:creator>
      <dc:date>2021-04-21T20:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Passing command/arguments to Run command tool - Powershell script</title>
      <link>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/750165#M8720</link>
      <description>&lt;P&gt;You can create a Batch Macro that updates the Run Command Tool with the desired file path at runtime.&amp;nbsp; Normally Batch Macros are used to repeat the same process multiple times.&amp;nbsp; However, repetition is not required.&amp;nbsp; You can send in one record and have it execute once, in other words.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll caution you regarding the file path that you have in your question.&amp;nbsp; Remember that, on Alteryx Server, the workflow will be running &lt;EM&gt;on the server itself,&amp;nbsp;&lt;/EM&gt;probably with a system account specified in the Server "Run As" System Settings.&amp;nbsp; So, under most circumstances, users will not have profile directories.&amp;nbsp; So C:\Users\xxxxx\Documents\ will not exist on the Server.&amp;nbsp; If I understand your use case, we mostly see that files are written out to a network file share instead, using UNC paths.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached please find a macro that does something similar with the Run Command Tool.&amp;nbsp; It moves or copies one or more files using file paths, passing the paths to either the COPY or MOVE command using Run Command.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Apr 2021 14:08:45 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/750165#M8720</guid>
      <dc:creator>ScottG</dc:creator>
      <dc:date>2021-04-22T14:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Passing command/arguments to Run command tool - Powershell script</title>
      <link>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/750648#M8733</link>
      <description>&lt;P&gt;Thank you for the direction. I have been struggling to make this work. Yes the&lt;SPAN&gt;&amp;nbsp;files will be written out to a network file share on alteryx server. I am just doing simple test of this solution on my local as poc.&amp;nbsp;&lt;/SPAN&gt;I am new to using macros so I have some questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1) I made an attempt using your macro. As soon i&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;remove the input file that I am trying to dynamically pass as input I get this attached error. "when there is an outgoing connection this tool required an input file to be configured" How should i resolve this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2) Also, do&amp;nbsp; I need to make any changes in order for the batch macro to perform this task only once?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 15:19:40 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/750648#M8733</guid>
      <dc:creator>Nikita-Puniani</dc:creator>
      <dc:date>2021-04-23T15:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Passing command/arguments to Run command tool - Powershell script</title>
      <link>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/750842#M8736</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/2169"&gt;@ScottG&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please guide on how to configure the workflow for this macro to work?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note -&amp;nbsp; I just want to be able to pass a filepath of an excel file&amp;nbsp; at run time in the run command tool&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 20:57:51 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/750842#M8736</guid>
      <dc:creator>Nikita-Puniani</dc:creator>
      <dc:date>2021-04-23T20:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Passing command/arguments to Run command tool - Powershell script</title>
      <link>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/750871#M8738</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/2169"&gt;@ScottG&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I am having difficulty comprehending many things in this macro.&amp;nbsp; It would be super helpful if you could provide me a simpler working solution that has both the macro and workflow.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 22:43:09 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/750871#M8738</guid>
      <dc:creator>Nikita-Puniani</dc:creator>
      <dc:date>2021-04-23T22:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Passing command/arguments to Run command tool - Powershell script</title>
      <link>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/751082#M8740</link>
      <description>&lt;P&gt;I tried to distill this down to just the basics.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is a workflow that has a macro that will launch Microsoft Excel, using Run Command.&amp;nbsp; The macro opens a &lt;EM&gt;specific&lt;/EM&gt; &lt;EM&gt;Excel file&lt;/EM&gt; by specifying the full path to the file on the command line.&amp;nbsp; In this same way, you can send in a file path to modify the behavior of the Run Command, by changing the command line argument.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that the path to Excel on my machine is&amp;nbsp;C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE.&amp;nbsp; If your Excel is installed in a different path, you will have to change the Run Command Tool "Command" setting.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Apr 2021 17:40:35 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/751082#M8740</guid>
      <dc:creator>ScottG</dc:creator>
      <dc:date>2021-04-25T17:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Passing command/arguments to Run command tool - Powershell script</title>
      <link>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/751458#M8741</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/2169"&gt;@ScottG&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is extremely helpful!!!&amp;nbsp; Due to an older version of alteryx unfortunately,&amp;nbsp; I am unable to import the packaged file. However I do understand and see the macro. Can you please send the screenshot of the workflow?&amp;nbsp; Assuming the workflow has the input file connected to the macro. Here is what I am seeing. If I missing seeing anything here please post picture of the workflow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nikita-Puniani_0-1619456191859.png" style="width: 400px;"&gt;&lt;img src="https://community.alteryx.com/t5/image/serverpage/image-id/181774i97A6A38613CD7C8A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nikita-Puniani_0-1619456191859.png" alt="Nikita-Puniani_0-1619456191859.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 16:57:14 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/751458#M8741</guid>
      <dc:creator>Nikita-Puniani</dc:creator>
      <dc:date>2021-04-26T16:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Passing command/arguments to Run command tool - Powershell script</title>
      <link>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/751542#M8742</link>
      <description>&lt;P&gt;I was able to get the results by combining the approaches in both the solutions you provided.&amp;nbsp; Thank you for the help. This was a good learning to understand how macros behave&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 18:48:09 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/751542#M8742</guid>
      <dc:creator>Nikita-Puniani</dc:creator>
      <dc:date>2021-04-26T18:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Passing command/arguments to Run command tool - Powershell script</title>
      <link>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/751585#M8743</link>
      <description>&lt;P&gt;I'm glad to hear that you got it working.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For anyone else that is on an older version of Alteryx, you just have to right-click in the workflow, choose Insert, Macro, and then select the macro file (OpenExcelFile.yxmc) included in the workflow package.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Temp.png" style="width: 263px;"&gt;&lt;img src="https://community.alteryx.com/t5/image/serverpage/image-id/181809i1D3A670687A0BD02/image-size/large?v=v2&amp;amp;px=999" role="button" title="Temp.png" alt="Temp.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 20:11:45 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Alteryx-Server-Discussions/Passing-command-arguments-to-Run-command-tool-Powershell-script/m-p/751585#M8743</guid>
      <dc:creator>ScottG</dc:creator>
      <dc:date>2021-04-26T20:11:45Z</dc:date>
    </item>
  </channel>
</rss>

