Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Help with Running a Powershell command using Scheduled task

$
0
0
I am running a Scheduled task and getting no text output
If I run the ps1 file itself it runs fine and gets me the output

the File contains the following code
------------------------
Get-Module–ListAvailable | import-module
Set-executionpolicy-scope currentuser -executionpolicy unrestricted
Get-XASession-BrowserName"IRD K-Flow Prod - V2" | Group AccountName | Select -Expand Group | Select AccountName, BrowserName | ft -auto> C:\userdump\tester.txt
------------------------
For the Task Scheduler I have created a Basic task

Start a Program
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Arguments
-NoProfile-File%SystemRoot%\system32\test.ps1

In desperation I have added the
Set-executionpolicy-scope currentuser -executionpolicy unrestricted
But still has not helped

Viewing all articles
Browse latest Browse all 6937

Trending Articles