Incorrect configuration may cause this.
Try following.
1. Run powershell script using a batch file.
powershell .\scriptname.ps1
2.
make sure following configuration.
Action Start Program
C:\Scripts\scriptname.bat
Start in C:\Scripts\
Select "run whether user logged in or not."
Sometime you may be running higher version of powershell that may also be issue. i faced this issues when i were trying to run powershell for sharepoint 2010 on Windows server 2012.
So you can use following command in batch file.
powershell -version 2 .\scriptname.ps1
No comments:
Post a Comment