< Back

Test-CredentialStoreItem

Sun Jan 19, 2020 6:36 pm

NAME Test-CredentialStoreItem



SYNOPSIS

Checks if the given RemoteHost identifier combination exists in the credential store.





SYNTAX

Test-CredentialStoreItem -RemoteHost <String> [-Identifier <String>] [<CommonParameters>]



Test-CredentialStoreItem [-Path <String>] -RemoteHost <String> [-Identifier <String>] [-Shared]

[<CommonParameters>]





DESCRIPTION

Use this cmdlet for basic checks with a single item. Check the item first with this function before

you try to interact with it.





PARAMETERS

-Path <String>

Define a custom credential store you try to read from. Without the `-Path` parameter

`Test-CredentialStoreItem` tries to read from the default private store.



Required? false

Position? named

Default value "{0}\\PSCredentialStore\\CredentialStore.json" -f $env:ProgramData

Accept pipeline input? false

Accept wildcard characters? false



-RemoteHost <String>

Specify the host, for which you would like to change the credentials.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Identifier <String>

Adds an optional identifier to the given RemoteHost. Makes it possible to store multiple credentials

for a single host.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Shared [<SwitchParameter>]

Switch to shared mode with this param. This enforces the command to work with a shared CredentialStore which

can be decrypted across systems.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

[None]





OUTPUTS

[None]





NOTES





- File Name : Test-CredentialStoreItem.ps1

- Author : Marco Blessing - marco.blessing@googlemail.com

- Requires :



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>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)

}











RELATED LINKS

https://github.com/OCram85/PSCredentialStore