Compare commits

..

No commits in common. "0c87e6b9c0049fd9c8399eabe82a54fc7b8aa193" and "ddb85d907f01c8f386a4b0661e2bcf426fca87fa" have entirely different histories.

View File

@ -32,7 +32,7 @@ function New-CredentialStoreItem {
[None] [None]
.EXAMPLE .EXAMPLE
New-CredentialStoreItem -Path 'C:\TMP\mystore.json' -RemoteHost 'esx01.myside.local' New-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local"
#> #>
[CmdletBinding(DefaultParameterSetName = 'Private')] [CmdletBinding(DefaultParameterSetName = 'Private')]
@ -68,7 +68,7 @@ function New-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
} }
@ -84,9 +84,9 @@ function New-CredentialStoreItem {
if (-not(Test-CredentialStore -Shared -Path $Path)) { if (-not(Test-CredentialStore -Shared -Path $Path)) {
$MessageParams = @{ $MessageParams = @{
Exception = [System.IO.FileNotFoundException]::new( Exception = [System.IO.FileNotFoundException]::new(
'The given credential store ({0}) does not exist!' -f $Path 'Could not add anything into the given CredentialStore.'
) )
ErrorAction = 'Stop' ErrorAction = "Stop"
} }
Write-Error @MessageParams Write-Error @MessageParams
} }
@ -95,8 +95,8 @@ function New-CredentialStoreItem {
$CurrentDate = Get-Date -Format 'u' $CurrentDate = Get-Date -Format 'u'
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