Powershell Syntax working when run in cmd, but when run through SCCM2007 Task Sequence it claims the syntax is incorrect?

The code below is a simple powershell statement which enables me to change the execution policy so that I can run powershell scripts. When I run this in a normal windows enviroment the statement will work fine, not giving me an issue whatsoever. However,
whenever it runs in the task sequence the TS fails. I am running this via the command line option in the task sequence, each time running this step as 3 different types of administrators.
powershell.exe -noninteractive Set-ExecutionPolicy -ExecutionPolicy unrestricted
Checking the log file it states this:
Set-ExecutionPolicy : The term 'Set-ExecutionPolicy' is not recognized as the InstallSoftware 13/10/2014 17:28:09 3768 (0x0EB8)
name of a cmdlet, function, script file, or operable program. Check the InstallSoftware 13/10/2014 17:28:09 3768 (0x0EB8)
spelling of the name, or if a path was included, verify that the path is InstallSoftware 13/10/2014 17:28:09 3768 (0x0EB8)
correct and try again. InstallSoftware 13/10/2014 17:28:09 3768 (0x0EB8)
At line:1 char:1 InstallSoftware 13/10/2014 17:28:09 3768 (0x0EB8)
+ Set-ExecutionPolicy -ExecutionPolicy unrestricted InstallSoftware 13/10/2014 17:28:09 3768 (0x0EB8)
+ ~~~~~~~~~~~~~~~~~~~ InstallSoftware 13/10/2014 17:28:09 3768 (0x0EB8)
+ CategoryInfo : ObjectNotFound: (Set-ExecutionPolicy:String) [], InstallSoftware 13/10/2014 17:28:09 3768 (0x0EB8)
CommandNotFoundException InstallSoftware 13/10/2014 17:28:09 3768 (0x0EB8)
+ FullyQualifiedErrorId : CommandNotFoundException InstallSoftware 13/10/2014 17:28:09 3768 (0x0EB8)
InstallSoftware 13/10/2014 17:28:09 3768 (0x0EB8)
Failed to run the action: Script Exception.
Incorrect function. (Error: 00000001; Source: Windows) TSManager 13/10/2014 17:28:09 2716 (0x0A9C)
I am new to both SCCM and Powershell, but from my point of view, this should work, considering that the syntax is not actually incorrect? Please could anyone with any idea drop some hints and tips on how to
stop this issue.

I'm not using 3 admin accounts at once if that's how it sounded. I have tried 3 different Admin accounts because I felt that perhaps the difference in permissions may have made a difference in whether I was able to run the syntax and scripts. So I tried
using my own personal administrator account, the SCCMNA account, and the local admin account, which I read worked.
At this point in the task sequence I have:
- Installed the OS
- Connected to the domain
- Installed Applications such as; Flash, Shockware, Reader etc.
Once it has installed the last application within a folder called "Helper Apps" (Which contains various Java and Adobe apps which install fine) it will then run a "Use Toolkit Package" using the MDT toolkit, once this stage is complete
it then progresses to the Script Exception section of the TS.
powershell.exe -noninteractive Set-ExecutionPolicy -ExecutionPolicy unrestricted
I obviously need this to work otherwise I am not allowed to run the script, but because this syntax is "incorrect" it stops the task sequence.
I hope this information might shed some more light on the situation.

Similar Messages

Maybe you are looking for

  • Firefox Nightly(28.0a.1) keeps crashing when i try to open it.

    I open Nightly, I click something and BAM the crash report comes up and says it crashed so i Click on the button that says 'Restart Nightly' and the same thing happens again. P.S. This all started happening after I updated nightly 28. And also : Trou

  • Won't update, can't download "current" repo list

    [max@pwn ~]$ sudo pacman -Syu :: Synchronizing package databases... error: failed to synchronize current: extra 314.8K 350.7K/s 00:00:01 [#####################] 100% community is up to date :: Starting full system upgrade... warning: dvd+rw-tools: fo

  • Which type to use in own method?

    Hi there, i am not so good in abap-objects so here is my question: i created a new method in my view in webdynpro for abap. in this method i declared a changing-parameter. this parameter must be of the same type as an internal table declared in my co

  • HT204411 error -42110 comes up when I want to view a rented movie?

    why can't i view a rented movie?  error -42110 problem in itunes store... try later!  But this continues over & over again?

  • How to Import exported mapping in SAP XI

    Hello I have a exported mapping from Integration repository file with .xim extension. How we can can import it another XI server. Thanks Chaitanya