remove terminating error

This commit is contained in:
OCram85 2022-07-19 11:12:36 +02:00
parent ae62cccfaa
commit cff5b6f04a
1 changed files with 7 additions and 3 deletions

View File

@ -7,6 +7,10 @@ function Test-CredentialStoreItem {
Use this cmdlet for basic checks with a single item. Check the item first with this function before Use this cmdlet for basic checks with a single item. Check the item first with this function before
you try to interact with it. you try to interact with it.
Breaking Change for `v1.1.0+`:
Test-CredentialStoreItem will return `$false` even if the store doesn't exist. We removed the terminating
error and replaced it with a warning message.
.PARAMETER Path .PARAMETER Path
Define a custom credential store you try to read from. Without the `-Path` parameter Define a custom credential store you try to read from. Without the `-Path` parameter
`Test-CredentialStoreItem` tries to read from the default private store. `Test-CredentialStoreItem` tries to read from the default private store.
@ -88,10 +92,10 @@ function Test-CredentialStoreItem {
} }
else { else {
$MsgParams = @{ $MsgParams = @{
ErrorAction = 'Stop' Message = "The given credential store ({0}) does not exist!" -f $Path
Message = "The given credential store ({0}) does not exist!" -f $Path
} }
Write-Error @MsgParams Write-Warning @MsgParams
return $false
} }
} }