title: Task Scheduler Launching openwith.exe program instead of PowerShell script
body: <p>I've have created a Powershell script that automatically connects to office 365 and sets all users default calendar permissions to reviewer. this script runs perfectly when executed manually.</p>
  
  <p>but</p>
  
  <p>I am trying to launch the powershell script via task scheduler on WS-2012-R2.</p>
  
  <p>i run the task but when i check a test users calendar permissions its still the same "contributor".</p>
  
  <p>When task scheduler starts the task, it creates a process, that process is given a process ID.</p>
  
  <p>i went to check the ID in task manager it showed as "Pick an App" under the processes tab.</p>
  
  <p>i right clicked and clicked details and it shows as OpenWith.exe</p>
  
  <p>i checked file association and (.PS1) is associated to WindowsPowershell</p>
  
  <p>i went to the scripts file location in explorer, Rclicked and changed the OPenWith from POwershell to Windows Powershell ISE and i still get the same thing when i run through task sheduler. ("pick and app &amp; OPenWith.exe")</p>
  
  <p>i have tried editing the "actions" in Task Manager to a combination of things such as.</p>
  
  <p>In task shceduler properties </p>
  
  <p>Program/script: was set to: C:\Powershell script\default reviewer permissions
  this doesnt work</p>
  
  <p>then i changed that to C:\Windows\System32\WindowsPowerShell\v1.0\POwershell and also PowerShell_ise</p>
  
  <p>with C:\Powershell script\default reviewer permissions in the "add arguments (optional) section.</p>
  
  <p>and visa versa</p>
  
  <p>Can anyone please tell me what i can do to make this script run.</p>
  
  <p>Many thanks </p>