title: How can I make this PowerShell script into one line
body: <p>This PowerShell script works great, but I need it to be a one line script, how can I create the parameter objects inline?</p>
  
  <pre><code>$action = New-ScheduledTaskAction -Execute 'Powershell.exe' -Argument 'invoke-command -scriptblock {iisreset}'
  $trigger =  New-ScheduledTaskTrigger -Daily -At 9am
  Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "Reset IIS" -Description "Daily Reset IIS"
  </code></pre>
  
  <p>e.g.</p>
  
  <pre><code>Register-ScheduledTask -Action `New-ScheduledTaskAction -Execute 'Powershell.exe' -Argument 'invoke-command -scriptblock {iisreset}'` -Trigger `New-ScheduledTaskTrigger -Daily -At 9am -TaskName "Reset IIS" -Description "Daily Reset IIS"`
  </code></pre>
  
  <p>I've tried wrapping it in double quotes and with backticks and with curly braces but no luck so far.</p>