PSCloudScript
22.1.17
I'm still adding content to this guide, so please be patient
I've been spending a fair amount lately playing around with running PowerShell scripts that are saved on the internet and I thought it would be helpful to share what I have leared on this ... so this guide will be focused on executing PowerShell scripts that are saved on the Internet, what I call a PSCloudScript
Method
The method for running a PowerShell script on the internet is to get the raw content of a URL using Invoke-RestMethod
, and then execute the result using Invoke-Expression
The following command lines are identical to the method above, just formatted differently. My preference is iex(irm $Uri)
as it is short and works for both PowerShell and CMD with minimal effort
KeyVault Secret Method
I'm jumping ahead here, but here is the command line for executing a PowerShell script saved as an Azure Key Vault Secret
Content
PS CmdletsGitHub GistGitHub Git RepoContent-Type | Azure Static Web AppCommand ShorteningAzure Key Vault SecretOSD PowerShell ModulePSCloudScript ExamplesSponsor
OSDeploy is sponsored by Recast Software and their Systems Management Tools
Last updated