/build/static/layout/Breadcrumb_cap_w.png

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 8 months ago
Blue Belt
1

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 8 months ago
White Belt
1

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


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


Comments:
  • Odd that fixed it. - AmberSDNB 8 months ago
 
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