Fix issue in Verify-Link.ps1 after PS 7.4 update (#5314)
https://learn.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-74?view=powershell-7.4 - Add AllowInsecureRedirect switch to Web cmdlets (#18546) That new option cause a new exception type that exposed a bug where we assumed if InnerException property existed that it was not null. This fix verifies that the property is not null. Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
This commit is contained in:
parent
46fcbbad52
commit
02882f9141
@ -260,7 +260,7 @@ function CheckLink ([System.Uri]$linkUri, $allowRetry=$true)
|
||||
$innerExceptionPresent = $_.Exception.psobject.Properties.name -contains "InnerException"
|
||||
|
||||
$errorCodePresent = $false
|
||||
if ($innerExceptionPresent) {
|
||||
if ($innerExceptionPresent -and $_.Exception.InnerException) {
|
||||
$errorCodePresent = $_.Exception.InnerException.psobject.Properties.name -contains "ErrorCode"
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user