Powershell script not running properly from SCCM

Matt picture Matt · Jul 30, 2011 · Viewed 11.1k times · Source

I'm trying to deploy Lego MindStorms through SCCM. I have a PowerShell script that I'm using to start the EXE and do some other things after the install. The PS1 file sits in the same directory as the EXE. The PowerShell script tries to run after the package gets downloaded, but the program doesn't get installed. I can go into the cache folder where the package was downloaded, right click the script and tell it to run, and the install kicks off fine.

This is what I put in the command line for the program in SCCM:
powershell.exe -executionpolicy bypass -file .\Install_MindStorms.ps1

I have also tried the same command as above without the .\ before the file name.

What is happening differently here where I can manually run the PS1 file from the downloaded package, but the same file isn't working correctly when it is run automatically through the advertised program after it has been downloaded from the distribution point?

Answer