Created
October 18, 2023 04:00
-
-
Save vukasinterzic/82416fea95ae4d715f353b4b07deccbe to your computer and use it in GitHub Desktop.
this script shows how to execute code stored in Gist from PowerShell.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Replace with your Gist's raw URL | |
$gistUrl = "https://gist.githubusercontent.com/yourusername/raw/yourgistID/yourscript.ps1" | |
#Option 1 | |
Invoke-RestMethod -Uri $gistUrl | Invoke-Expression | |
#Option 2 | |
Invoke-Expression ((New-Object System.net.WebClient).DownloadString('$gistUrl')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment