I have searched high and low trying to figure out how to output the results for a simple PowerShell script file named Admin.ps1 that contains the cmdlet Get-ADDefualtDomainPasswordPolicy from the Run Command tool to an output tool, in this case the Browse tool. However, when I do this I get this well documented error.
All of the solutions I've read indicate you have to identify a Read source when you have a Write Source, even if it’s not technically necessary. So, in my workflow I made the Admin.ps1 file the read source and now workflow runs and I can see PowerShell opening and running with no error codes returned.
However, what appears in the Browse tool is the Cmdlet found in the Admin.ps1 file. This is obviously not what I want. I want to see the results from the Cmdlet.
If anyone can show me how to do this, you're automatically on my Christmas list.
Solved! Go to Solution.
hi buddy
how u created this file _externals\1\PowerShellHelloAndDate.ps1 ?
hi buddy how u created this .ps1 file that u used in input data tool
or what you did, first u wrote the script then run it in powershell then u get a txt (storing response from ) file and then you use it as read result in run command,
or you just wrote the script and didn't run and u directly use in w/f?
I tried to as your purposed solution but getting error
1: if i am using "powershell" in command the i get error "
Hi @curator_at_work, I'm definitely not an expert with this Run tool but let's break down what I previously did
1) I opened notepad++ and created the script in there. I saved the file as a .ps1 as this was an acceptable extension for a powershell script.
2) I read the script into alteryx using a file input
3) I realised that each line of the script was split out onto a new line in alteryx. Therefore, I used the summarise tool to concatenate all the lines into a single cell (this helped as I wanted to pass this into the run tool)
4) Last step was the Run Command tool. I've got numbers on the picture which I'll explain below
(1) This takes the script from the single cell I created from the summarise tool and outputs it to a file called RandomFile.ps1 in the temporary directory
(2) I want to tell the Run Command I want to use Powershell, so I write "Powershell"
(3) I want Powershell to then run this RandomFile.ps1 I created in step one. So I call on it again! (as it's now been created..)
(4) I display the results in the Alteryx window, although, you don't need this step to be honest:
I've reuploaded the example file so you can download it and try it out yourself.
Hopefully that gets you further along with the problem at hand.