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
1
Invoke-RestMethod-Uri $Uri|Invoke-Expression
Copied!
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