powershell script through run command tool
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hoe to configure run command tool to execute following powershell script
" Get-ChildItem -Path "C:\" -Recurse | Select-Object FullName,
@{Name="Size (Bytes)";Expression={$_.Length}},
CreationTime,
LastWriteTime |
Export-Csv -Path C:\downloads\DriveContent9.txt -NoTypeInformation
"
your small help means a lot to me
- Labels:
- Run Command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @curator_at_work, check out this solved discussion post with an example attached to get you started with configuring the command tool to run powershell: https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Using-Run-Command-tool-to-exec...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
not so helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Sorry to hear the discussion post wasn't helpful! Do you have an in-progress workflow you could share or an error message you are getting?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi, @curator_at_work
1- Command:
PowerShell.exe
2- Command Arguments [Optional]:
-ExecutionPolicy Bypass -Command "& {Get-ChildItem -Path 'C:' -Recurse | Select-Object FullName, @{Name='Size (Bytes)';Expression={$_.Length}}, CreationTime, LastWriteTime | Export-Csv -Path 'C:\downloads\DriveContent9.txt' -NoTypeInformation}"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@flying008-> can you share your wisdom on this thread too (https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Run-Command-Tool-configuration...) -> it's basically an identical use case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi, @apathetichell
IMHO, Ask real questions, Get the complete answer!
At present, @curator_at_work did not describe in detail what the real needs are.
1- If you only want to manually enter the script content in the Run Command tool, you can refer to the setting animation above. The only thing to pay attention to is the Output and Input in the dialog box. You can ignore the Input, and the Output can set any file name under the temporary folder path. It is best to add a Sample tool before the Run Command tool to let it output only one line of records. This will reduce unnecessary disk overhead and will not affect the script running.
2- If you want Run Command to accept the script as the output from the previous tool, you need to use a tool like Formula or Txt Input to generate the content of server.ps1, and then use Output in the Run Command tool to receive the full path of server.ps1, and then fill in the parameters and run it according to the syntax similar to powershell.exe -ExecutionPolicy Bypass "d:\123\server.ps1".
3- However, it's a good idea to describe your desired result and show it with screenshots if you can. @curator_at_work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
thanks @flying008 for your detailed efforts i want to know
what's there in text input tool ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hi @flying008
I do exact the same config, getting below error, have a look
I think we are missing something, because the code that I am passing in text input tool, the same I am getting in drivecontent9.txt file that I am using in output of run command tool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hi @MeganBowers
I shared on this same thread , you can look at.
