Skip to content

Commit

Permalink
Update run.ps1
Browse files Browse the repository at this point in the history
Make it not cache so that you actually get the latest or alpha versions if you are running it many times perhaps for example to test the script and make sure it is working as i am doing
  • Loading branch information
starchyunderscore authored Oct 16, 2023
1 parent 8f6fbf8 commit ab6ba0c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions current/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:
}
# Get latest version information
Write-Output "`nFetching latest version information..."
$getLatest = Invoke-WebRequest -UseBasicParsing "https://api.github.com/repos/starchyunderscore/w11-nonadmin-utils/releases/latest" | ConvertFrom-Json
$getLatest = Invoke-WebRequest -UseBasicParsing "https://api.github.com/repos/starchyunderscore/w11-nonadmin-utils/releases/latest" -Headers @{"Cache-Control"="no-cache"} | ConvertFrom-Json
$latest = $getLatest.tag_name.Substring(0)
Write-Output "...Done`n"
# Ask what the user wants to do
Expand All @@ -27,13 +27,13 @@ if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:
1 { # Latest
Write-Output "Downloading"
Write-Output "Running"
Invoke-webRequest -UseBasicParsing "https://github.com/starchyunderscore/w11-nonadmin-utils/releases/download/$latest/setup.ps1" | Invoke-Expression
Invoke-webRequest -UseBasicParsing "https://github.com/starchyunderscore/w11-nonadmin-utils/releases/download/$latest/setup.ps1" -Headers @{"Cache-Control"="no-cache"} | Invoke-Expression
Write-Output "Done"
}
2 { # Alpha
Write-Output "Downloading"
Write-Output "Running"
Invoke-webRequest -UseBasicParsing "https://raw.githubusercontent.com/starchyunderscore/w11-nonadmin-utils/main/current/setup.ps1" | Invoke-Expression
Invoke-webRequest -UseBasicParsing "https://raw.githubusercontent.com/starchyunderscore/w11-nonadmin-utils/main/current/setup.ps1" -Headers @{"Cache-Control"="no-cache"} | Invoke-Expression
Write-Output "Done"
}
}
Expand All @@ -50,7 +50,7 @@ if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:
Write-Output "Canceled"
} else {
Write-Output "Downloading"
Invoke-webRequest -UseBasicParsing "https://github.com/starchyunderscore/w11-nonadmin-utils/releases/download/$latest/setup.ps1" -OutFile $savelc
Invoke-webRequest -UseBasicParsing "https://github.com/starchyunderscore/w11-nonadmin-utils/releases/download/$latest/setup.ps1" -Headers @{"Cache-Control"="no-cache"} -OutFile $savelc
Write-Output "Done"
}
}
Expand All @@ -60,7 +60,7 @@ if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:
Write-Output "Canceled"
} else {
Write-Output "Downloading"
Invoke-webRequest -UseBasicParsing "https://raw.githubusercontent.com/starchyunderscore/w11-nonadmin-utils/main/current/setup.ps1" -OutFile $savelc
Invoke-webRequest -UseBasicParsing "https://raw.githubusercontent.com/starchyunderscore/w11-nonadmin-utils/main/current/setup.ps1" -Headers @{"Cache-Control"="no-cache"} -OutFile $savelc
Write-Output "Done"
}
}
Expand Down

0 comments on commit ab6ba0c

Please sign in to comment.