Skip to content

Commit

Permalink
Fixing redirect resolution for 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
FriedrichWeinmann committed Jan 3, 2025
1 parent 9e4a9fd commit d3c7dd5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions PSFramework.NuGet/internal/functions/Other/Resolve-AkaMsLink.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
try { $null = Invoke-WebRequest -Uri $Name -MaximumRedirection 1 -ErrorAction Stop }
catch {
# Not doing a version check, since exact cut-over version between behaviors unknown
# PS ?+
if ($_.TargetObject.RequestUri.AbsoluteUri) {
$_.TargetObject.RequestUri.AbsoluteUri
}
# PS 5.1
else {
if ($_.TargetObject.Address.AbsoluteUri) {
$_.TargetObject.Address.AbsoluteUri
}
# PS ?+
else {
$_.TargetObject.RequestUri.AbsoluteUri
}
}
}
}

0 comments on commit d3c7dd5

Please sign in to comment.