Skip to content

Instantly share code, notes, and snippets.

@radamhu
Last active February 5, 2022 14:07
Show Gist options
  • Save radamhu/1e26300e6996364adbb7d3f4a7d79bdf to your computer and use it in GitHub Desktop.
Save radamhu/1e26300e6996364adbb7d3f4a7d79bdf to your computer and use it in GitHub Desktop.
# $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')"
@radamhu
Copy link
Author

radamhu commented Feb 5, 2022

live

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment