Skip to content

Instantly share code, notes, and snippets.

@ryancbutler
Last active October 4, 2019 13:38
Show Gist options
  • Save ryancbutler/5abe117969d1752e716f2b5b75b2470c to your computer and use it in GitHub Desktop.
Save ryancbutler/5abe117969d1752e716f2b5b75b2470c to your computer and use it in GitHub Desktop.
$download = Invoke-WebRequest -UseBasicParsing -Uri ("https://www.citrix.com/downloads/workspace-app/windows/workspace-app-for-windows-latest.html") -SessionVariable websession
$href = $download.Links|Where-Object {$_.rel -like "*CitrixWorkspaceApp.exe*"}
$DLurl = "https:" + $href.rel
Invoke-WebRequest -Uri ($DLurl) -WebSession $websession -UseBasicParsing -OutFile "C:\temp\CitrixWorkspaceApp.exe" -Verbose
$version = $download.RawContent | Select-String '(?<=.*<p>Version:&nbsp;).+?(?=<\/p>.*)' -AllMatches | ForEach-Object { $_.Matches.Value } | Select-Object -Unique
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment