Skip to content

Instantly share code, notes, and snippets.

@timgaunt
Last active July 23, 2017 03:51
Show Gist options
  • Save timgaunt/8862724 to your computer and use it in GitHub Desktop.
Save timgaunt/8862724 to your computer and use it in GitHub Desktop.
Call a url from PowerShell -useful for scheduling tasks in Windows
-ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadString(\"http://...aspx\")"
-ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadString($d=Get-Date;$t='{0:yyyyMMddTHHmmssZ}' -f $d.AddMinutes(-2);$f='{0:yyyyMMddTHHmmssZ}' -f $d.AddMinutes(-8);$url=\"http://...aspx?from=\" + $f + \"&to=\" + $t;write-host $url)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment