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?

0 Comments   [ + ] Show comments

Answers (2)

Posted by: AmberSDNB 1 month ago
Orange Belt

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. 

Posted by: tmapes 1 month ago
White Belt

I fixed it by change the execution policy to remotesigned.  bypass never worked.

powershell -nologo -executionpolicy remotesigned -noprofile -file JoinToDomain.ps1

This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ