corso/src/cmd/graph_pwsh/Execute-Script.ps1
Georgi Matev 3cf3e664aa
Add support for remote scripts to pwsh troubleshooter (#3051)
Add the ability to pull a Gist (or other downloadable script) and execute it. 
---

#### Does this PR need a docs update or release note?

- [ ]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [x]  No

#### Type of change

<!--- Please check the type of change your PR introduces: --->
- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [x] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* #<issue>

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
2023-04-07 17:19:29 +00:00

15 lines
346 B
PowerShell

[CmdletBinding()]
Param (
[Parameter(Mandatory = $True, HelpMessage = "Powershell script URL")]
[string]$ScriptURL
)
Invoke-WebRequest -Uri $ScriptURL -OutFile ./script.ps1
Write-Host "Executing the following script"
Write-Host "=============================="
cat ./script.ps1
Write-Host "=============================="
./script.ps1