Deploying Powershell Scripts with KACE SDA
What should I do when I add my PowerShell script to KACE SDA Post installation tasks. Should I remove all the built in options and just call the .ps1?
powershell -nologo -executionpolicy bypass -noprofile -file createcordicateaccount.ps1
Should it just be createcordicataccount.ps1?
Answers (2)
I guess there are sometimes issues with calling the PS directly. Adding quotes around your whole command may help.
"powershell -nologo -executionpolicy bypass -noprofile -file createcordicateaccount.ps1"
You don't have a space, but also recommended to have no spaces in your powershell filename. To troubleshoot, look at the tasks.xml file.
If you're still having issues, best to probably just create a zip file or exe (using something like SFX Package Maker) that contains a batch file and the ps file. Call the batch script (or exe if you use that method) in the post task Parameter field and in the batch file, call the powershell file.