Welcome to the Indigo Rose Software discussion forums! You will need to sign up for a forum account and login before you can post. Need help? View the Forum FAQ.
Announcement
Collapse
No announcement yet.
Running Powershell Script from inside Setup Factory
Hi there,
I've tried to run powershell from inside Setup Factory but I get a script error (with no error stored in Application.GetLastError()) when I try to run it.
My setup factory code is
success1 = File.Run("C:\Windows\System32\WindowsPowerShell\v1 .0\powershell.exe","C:\Docs\Latest\Work\2022\01-January\Test1.ps1","C:\Docs\Latest\Work\2022\01-January",SW_SHOWNORMAL,false);
If I run (from a CMD command line) C:\Windows\System32\WindowsPowerShell\v1 .0\powershell.exe C:\Docs\Latest\Work\2022\01-January\Test1.ps1 it works perfectly (the Test1.ps just writes some output to a file using:
Get-ChildItem "C:\Windows\System32" | Out-File "C:\Docs\Latest\Work\2022\Test.txt"
)
What am I doing wrong? The powershell command works fine when not run from Setup factory, but seemingly not from within.
Thanks in advance,
John
Without seeing the actual code, it is impossible to say for sure what you are doing wrong, but just looking at the text you pasted, it appears as there are many missing backslashes.
Comment