-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Area-Maintainers-Documentationspecific to documentation in this repospecific to documentation in this repoResolution-FixedThe issue is fixed.The issue is fixed.
Description
As part of PR 4612, it was found that the current guideline here recommends this approach
It "Get-Item on a nonexisting file should have error PathNotFound" {
try
{
get-item "ThisFileCannotPossiblyExist" -ErrorAction Stop
throw "No Exception!"
}
catch
{
$_.FullyQualifiedErrorId | should be "PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand"
}
}
However, @iSazonov suggests here that the guideline should be updated to this pattern:
{ get-item "ThisFileCannotPossiblyExist" -ErrorAction Stop } | ShouldBeErrorId "PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand"
Metadata
Metadata
Assignees
Labels
Area-Maintainers-Documentationspecific to documentation in this repospecific to documentation in this repoResolution-FixedThe issue is fixed.The issue is fixed.