Last active
February 5, 2022 14:07
-
-
Save radamhu/1e26300e6996364adbb7d3f4a7d79bdf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $credentials="<github_access_token>" | |
$repo = "fusioninventory/fusioninventory-agent" | |
$file = "fusioninventory-agent_windows-x64_*.exe" | |
$latestRelease = Invoke-WebRequest https://github.com/$repo/releases/latest -Headers @{"Accept"="application/json"} | |
$json = $latestRelease.Content | ConvertFrom-Json | |
$latestVersion = $json.tag_name | |
$latestVersionFile = "fusioninventory-agent_windows-x64_$latestVersion.exe" | |
$url = "https://github.com/$repo/releases/download/$latestVersion/$latestVersionFile" | |
# this uses IE engine | |
Invoke-WebRequest -Uri $url -OutFile "$latestVersionFile" | |
Get-ChildItem | |
#powershell -Command "(new-object net.webclient).DownloadString('$url')" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
live