title: PowerShell Script not running with the task scheduler
body: <p>So I created a PowerShell script that installs Windows Updates, </p>
  
  <p>As you may know, when installing updates, it's possible that the PC has to reboot (while there are still updates left) in order for installing the scripts. </p>
  
  <p>What I implemented was a task that get's imported at the start of the script and runs the script after each reboot (and installs the remaining script at the logon screen) untill there are no more scripts left. </p>
  
  <p>After the last updates, the script will remove the task out of the task scheduler.</p>
  
  <p>My implementations (downloading/installing/adding the task /removing the task) work perfectly.</p>
  
  <p>It's only that my script won't run after a reboot and I have no idea why! </p>
  
  <p>This is my task: 
  <a href="https://i.stack.imgur.com/Qe6mC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Qe6mC.png" alt="enter image description here"></a></p>
  
  <p>After the pc get's rebooted though, the script doesn't run anymore and the error in the task scheduler states <strong>0x1</strong></p>
  
  <p>I have done some Googling and found that the argument might be wrong (third picture WITH the path being correct of course) but I have tried (in the arguments field):</p>
  
  <ul>
  <li>(no quotes) -file path </li>
  <li>-ExecutionPolicy Bypass -file path </li>
  <li>-NoProfile -ExecutionPolicy Bypass -file path -force</li>
  <li>mixing above combinations with quotes added or left out </li>
  </ul>
  
  <p>What could be the problem of the task scheduler not launching my script? </p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Added screenshot of Log on as a batch job properties: </p>
  
  <p><a href="https://i.stack.imgur.com/7jz1g.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7jz1g.png" alt="enter image description here"></a></p>