Run powershell command as scheduled task

Last updated:

POWERSHELL

Define action as:

# Action as:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

# Arguments as : -Command &{} 
-command &{get-process >> c:\fso\ServiceProcessBios.txt; get-service | where{$_.Status -eq ‘Running’} >> c:\fso\ServiceProcessBios.txt; Get-WmiObject Win32_bios >> c:\fso\ServiceProcessBios.txt}

references:

Use Scheduled Tasks to Run PowerShell Commands on Windows - Scripting Blog [archived] (microsoft.com)