Skip to content

Instantly share code, notes, and snippets.

@kan6004
Created January 5, 2015 08:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kan6004/164a483aac70a5bb4ca4 to your computer and use it in GitHub Desktop.
Save kan6004/164a483aac70a5bb4ca4 to your computer and use it in GitHub Desktop.
2015.1.5 samplecode3
$command = "powershell.exe"
$argument = '-command "C:\temp\test.ps1"'
Invoke-Command -Session $s -Scriptblock{
$action = $null;
$action = New-ScheduledTaskAction -Execute $args[0] -Argument $args[1]
} -ArgumentList $command, $argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment