Schedule a Powershell Task

To Check Powershell version, use the built in variable: $PSVersionTable. Don’t use Get-Host. It just shows you the version of the host (i.e. of Console.Exe).

  • Open Task Scheduler on Windows
  • Click on Create Task
  • Make sure you select, when applicable, Run whether user is logged on or not and Run with highest privilege.  Set Action as follows:
  • pw_action
  • The argument for powershell is: -ExecutionPolicy Bypass -File (full path to powershell file) -Windowstyle hidden.  Note, omit parentheses.