Fix Set-CredentialStoreItem #76

Merged
OCram85 merged 7 commits from pinguinfuss/PSCredentialStore:Fix-Set-CredentialStoreItem into master 2022-10-10 10:05:08 +02:00
Showing only changes of commit c086015272 - Show all commits

View File

@ -33,11 +33,11 @@ function Test-CredentialStoreItem {
[None]
.EXAMPLE
if (Test-CredentialStoreItem -RemoteHost "Default") {
Get-CredentialStoreItem -RemoteHost "Default"
if (Test-CredentialStoreItem -RemoteHost 'Default') {
Get-CredentialStoreItem -RemoteHost 'Default'
}
else {
Write-Warning ("The given Remote Host {0} does not exist in the credential Store!" -f $RemoteHost)
Write-Warning ('The given Remote Host {0} does not exist in the credential Store!' -f $RemoteHost)
}
#>
@ -45,7 +45,7 @@ function Test-CredentialStoreItem {
[OutputType([bool])]
param (
[Parameter(Mandatory = $false, ParameterSetName = 'Shared')]
[string]$Path = "{0}\PSCredentialStore\CredentialStore.json" -f $env:ProgramData,
[string]$Path = '{0}\PSCredentialStore\CredentialStore.json' -f $env:ProgramData,
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
@ -61,7 +61,7 @@ function Test-CredentialStoreItem {
begin {
# Set the CredentialStore for private, shared or custom mode.
Write-Debug ("ParameterSetName: {0}" -f $PSCmdlet.ParameterSetName)
Write-Debug ('ParameterSetName: {0}' -f $PSCmdlet.ParameterSetName)
if ($PSCmdlet.ParameterSetName -eq 'Private') {
$Path = Get-DefaultCredentialStorePath
}
@ -73,8 +73,8 @@ function Test-CredentialStoreItem {
}
process {
if ($Identifier -ne "") {
$CredentialName = $RemoteHost = "{0}/{1}" -f $Identifier, $RemoteHost
if ($Identifier -ne '') {
$CredentialName = $RemoteHost = '{0}/{1}' -f $Identifier, $RemoteHost
}
else {
$CredentialName = $RemoteHost
@ -92,7 +92,7 @@ function Test-CredentialStoreItem {
}
else {
$MsgParams = @{
Message = "The given credential store ({0}) does not exist!" -f $Path
Message = 'The given credential store ({0}) does not exist!' -f $Path
}
Write-Warning @MsgParams
return $false