I always test my command lines using Psexec -s -i. What does the command line
do if you test it using psexec?
The only other thing I can think of is the path to the script may be causing
issues. does .\ really ersolve to where the script is located when the program
executes?
Jeff
From: [email protected]
To: [email protected]
Date: Tue, 6 Jan 2015 10:18:03 -0500
Subject: [mssms] Deploy PowerShell script
We are running SCCM 2012 R2 CU1 with Windows 7 64bit clients. I have a simple
script that I am trying to deploy as a package/program. The command line is:
%WINDIR%\Sysnative\WindowsPowerShell\v1.0\powershell.exe -executionpolicy
Bypass -file .\Remove2010LNK.PS1 If I manually run the script from within
powershell, it works fine. If I deploy it from SCCM, it says it runs
successfully but I can tell it does not, and it also completes in seconds when
it should take a couple minutes. I’ve tried sending it out via a task sequence
with the same result, it says it runs successfully but it isn’t. The only odd
thing I noted in the EXECMGR log is: Running
"C:\Windows\sysnative\WindowsPowerShell\v1.0\powershell.exe" -executionpolicy
Bypass -file .\Remove2010LNK.PS1 with 32bitLauncher Should it still state “with
32bitlauncher” if I am telling it to use the 64bit one? My last recourse may be
to take the script lines and shove it into a CMD batch file, but I’d really
like to figure out why this isn’t working. Thanks. Mark Kent (MCP)Sr.
Desktop Systems EngineerComputing & Technology Services - SUNY Buffalo State