Last active
July 12, 2021 11:08
-
-
Save adotcoop/afafbf0663263c88e1ab1b86e3cfc8b8 to your computer and use it in GitHub Desktop.
Get version and url for tableau products using url redirects
This file contains 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
# version match regex | |
$matchversion = "(\d+(\-\d+){1,3})" | |
# tableau reader | |
$tr = Invoke-WebRequest -UseBasicParsing -Uri "https://www.tableau.com/downloads/reader/pc64" -MaximumRedirection 0 -ErrorAction Ignore | |
$trversion = [RegEx]::Match($tr.Headers.Location, $matchversion) | Select-Object -ExpandProperty Value -Unique | |
$tr.Headers.Location | |
$trversion.Replace('-','.') | |
# tableau desktop | |
$td = Invoke-WebRequest -UseBasicParsing -Uri "https://www.tableau.com/downloads/desktop/pc64" -MaximumRedirection 0 -ErrorAction Ignore | |
$tdversion = [RegEx]::Match($td.Headers.Location, $matchversion) | Select-Object -ExpandProperty Value -Unique | |
$td.Headers.Location | |
$tdversion.Replace('-','.') | |
# tableau prep | |
$tp = Invoke-WebRequest -UseBasicParsing -Uri "https://www.tableau.com/downloads/prep/pc64" -MaximumRedirection 0 -ErrorAction Ignore | |
$tpversion = [RegEx]::Match($tp.Headers.Location, $matchversion) | Select-Object -ExpandProperty Value -Unique | |
$tp.Headers.Location | |
$tpversion.Replace('-','.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment