Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (29 sloc) 982 Bytes
#Get the required params
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$URI = "$Username/$Repo/contents/$FileName"
$Headers = @{
accept = "application/vnd.github.v3.raw"
authorization = "Token " + $Token
Write-Host "Starting powershell script $Filename from $Repo..." -ForegroundColor Yellow
$Script = Invoke-RestMethod -Uri $URI -Headers $Headers
Invoke-Expression $Script
catch [System.Net.WebException]
Write-Host "Error connecting to $Filename. Please check your file name or repo name and try again." -ForegroundColor Red
Write-Host "Success. Now executing $Filename from $Repo." -ForegroundColor Green
You can’t perform that action at this time.