diff --git a/private/functions/Get-LoginPasswordHash.ps1 b/private/functions/Get-LoginPasswordHash.ps1 index 343e1f7e871..6e1518fcdba 100644 --- a/private/functions/Get-LoginPasswordHash.ps1 +++ b/private/functions/Get-LoginPasswordHash.ps1 @@ -68,7 +68,9 @@ function Get-LoginPasswordHash { $hashedPassDt = $server.ConnectionContext.ExecuteWithResults($sql) $hashedPass = $hashedPassDt.Tables[0].Rows[0].Item(0) } catch { - Stop-Function -Message "Failed to retrieve password hash for login $($Login.Name)" -ErrorRecord $_ -Target $Login -Continue + # No -Continue here: no loop encloses this catch, so the continue would escape the function + # and bypass the null-hash handling of the caller (#10638). + Stop-Function -Message "Failed to retrieve password hash for login $($Login.Name)" -ErrorRecord $_ -Target $Login return } }