Fix string quotation

This commit is contained in:
pinguinfuss 2022-10-06 21:07:41 +02:00
parent a36b53c1a5
commit c086015272

View File

@ -33,11 +33,11 @@ function Test-CredentialStoreItem {
[None] [None]
.EXAMPLE .EXAMPLE
if (Test-CredentialStoreItem -RemoteHost "Default") { if (Test-CredentialStoreItem -RemoteHost 'Default') {
Get-CredentialStoreItem -RemoteHost "Default" Get-CredentialStoreItem -RemoteHost 'Default'
} }
else { 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])] [OutputType([bool])]
param ( param (
[Parameter(Mandatory = $false, ParameterSetName = 'Shared')] [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)] [Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
@ -61,7 +61,7 @@ function Test-CredentialStoreItem {
begin { begin {
# Set the CredentialStore for private, shared or custom mode. # 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') { if ($PSCmdlet.ParameterSetName -eq 'Private') {
$Path = Get-DefaultCredentialStorePath $Path = Get-DefaultCredentialStorePath
} }
@ -73,8 +73,8 @@ function Test-CredentialStoreItem {
} }
process { process {
if ($Identifier -ne "") { if ($Identifier -ne '') {
$CredentialName = $RemoteHost = "{0}/{1}" -f $Identifier, $RemoteHost $CredentialName = $RemoteHost = '{0}/{1}' -f $Identifier, $RemoteHost
} }
else { else {
$CredentialName = $RemoteHost $CredentialName = $RemoteHost
@ -92,7 +92,7 @@ function Test-CredentialStoreItem {
} }
else { else {
$MsgParams = @{ $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 Write-Warning @MsgParams
return $false return $false