New-CredentialStoreItem-Warn-If-CredentialStore-Doesnt-Exist #72

Closed
pinguinfuss wants to merge 6 commits from pinguinfuss:New-CredentialStoreItem-Warn-If-CredentialStore-Doesnt-Exist into master
Showing only changes of commit 0c87e6b9c0 - Show all commits

View File

@ -32,7 +32,7 @@ function New-CredentialStoreItem {
[None]
.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')]
@ -68,7 +68,7 @@ function New-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
}
@ -86,7 +86,7 @@ function New-CredentialStoreItem {
Exception = [System.IO.FileNotFoundException]::new(
'The given credential store ({0}) does not exist!' -f $Path
)
ErrorAction = "Stop"
ErrorAction = 'Stop'
}
Write-Error @MessageParams
}
@ -95,8 +95,8 @@ function New-CredentialStoreItem {
$CurrentDate = Get-Date -Format 'u'
if ($Identifier -ne "") {
$CredentialName = $RemoteHost = "{0}/{1}" -f $Identifier, $RemoteHost
if ($Identifier -ne '') {
$CredentialName = $RemoteHost = '{0}/{1}' -f $Identifier, $RemoteHost
}
else {
$CredentialName = $RemoteHost