fix Test-CredentialStoreItem return #66

Merged
OCram85 merged 2 commits from fixTestItem into master 2022-07-19 11:46:22 +02:00
Showing only changes of commit cff5b6f04a - Show all commits

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
} }
} }