Link to home
Create AccountLog in
Avatar of wajhiuddin
wajhiuddin

asked on

Run a powershell on MDT Task Sequence

I am running a powershell script on my MDT Task Sequance  which is just fpr a test
Script runs but it does not produce results because it doen't run in unrestrected mode
So I added anohter script with folloiwng command to run before my test script
 Set-ExecutionPolicy -ExecutionPolicy Unrestricted -force (It has to be run as admin but looks like Task Sequence is not running this command as an admin) and  my test script still run as a restricted mode.
 
 Again  Test script runs(it creartes a folder "Temp" which is suppose to be created ) but without result ?
 Please see my script which runs absolutely fine with unrestricted policy
 So the problem I have I can't have PowerShell run as unrestricted
 Thanks

ProtTest.ps1.txt
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of wajhiuddin
wajhiuddin

ASKER

I tried to run the script as directed on to the follwoing link and it did work but don't know why my script doesn't
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: David Johnson CD MVP (https:#a42069809)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

exchangepro
Experts-Exchange Cleanup Volunteer