We need to always set -Shared (even if we have to set it to $false)

This commit is contained in:
pinguinfuss 2022-10-06 21:42:50 +02:00
parent c086015272
commit 90f82b137d
1 changed files with 4 additions and 1 deletions

View File

@ -83,9 +83,12 @@ function Set-CredentialStoreItem {
}
# Check if the user passed -Shared. If he added -Shared, we'll pass it into the splatting
if ($PSCmdlet.ParameterSetName -eq 'Shared') {
if ($PSBoundParameters.ContainsKey('Shared')) {
$DefaultSplatting.Add('Shared', $true)
}
else {
$DefaultSplatting.Add('Shared', $false)
}
# Now lets check the given CredentialStore.
if (-not(Test-CredentialStore @DefaultSplatting)) {