community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx Knowledge Base

Definitive answers from Designer experts.

Alteryx and Powershell

Alteryx
Alteryx
Created on

Question

Can Alteryx run a Powershell script or perform any Powershell specific commands?

Answer

 Yes! We can use the Run Command Tool to do exactly that.

 

Note: In order to run powershell scripts you must make sure you have scripting enabled. You should consult with your IT department to see if you are allowed to enable this functionality.

 

Below is an example I made in 10.6 demonstrating the necessary run command tool configuration. The command will just be “powershell” to enable powershell mode in cmd.exe. Then your command arguments should be the path where the script is located so it can run:

 

runcommandconfig.jpg

 

In this particular case I want to read into the Designer the results of my script, so I specify the file that is being written as the Read Results. My “helloworld.ps1” script only contains the below:

 

"Hello World" | Out-File c:\temp\test1.txt

 

 As you can see, this kicks off in the Designer and opens the script output file to continue downstream, successfully implementing Powershell scripting:

 

powershellbrowse.jpg

Comments
Alteryx Certified Partner

I have noticed powershell is not working anymore after upgrading to 11.7. Can you confirm?

Meteor

Hi, this was helpful, thanks!

 

One note - I had a script located in a folder with spaces in the name like C:\foo bar\baz.ps1 and had to use single quotes instead of double quotes in the Command Arguments, e.g. & 'C:\foo bar\baz.ps1' worked while  & "C:\foo bar\baz.ps1" errored out with error code 1.

 

Jonathan