< Back

New-CredentialStore

Sun Jan 19, 2020 6:36 pm

NAME New-CredentialStore



SYNOPSIS

Creates a new credential store File





SYNTAX

New-CredentialStore [-Force] [-PassThru] [-SkipPFXCertCreation] [-UseCertStore] [-WhatIf] [-Confirm]

[<CommonParameters>]



New-CredentialStore -Shared [-Path <FileInfo>] [-Force] [-PassThru] [-SkipPFXCertCreation] [-UseCertStore]

[-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

You need to run this script first to create a new credential store before you try to

save new credentials with New-CredentialStoreItem.





PARAMETERS

-Shared [<SwitchParameter>]

Creates a CredentialStore in the Shared mode. This enables you to read the CredentialStore Items on

different systems or profiles. In addition you can optionally provide a custom path wit the -Path parameter.



Required? true

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Path <FileInfo>

Define a location for the new shared CredentialStore. The default store will be created in

$Env:ProgramData\\PSCredentialStore dir.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Force [<SwitchParameter>]

Use this switch to reset an existing store. The complete content will be wiped.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-PassThru [<SwitchParameter>]



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-SkipPFXCertCreation [<SwitchParameter>]

You can skip the pfx certificate creation process. This makes sense if you have a previously created cert or

want to

import a cert in cross-platform environments.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-UseCertStore [<SwitchParameter>]

Instead of using a plain pfx file beside your CredentialStore file you can import it into the user or machine

certificate store. In this case the system itself secures the cert and you don't hat to set custom NTFS

permissions so secure your shared certificate.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

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

['PSCredentialStore.Store'] Returns the recently created CredentialStore object if the -PassThru parameter

was given.





NOTES





- File Name : New-CredentialStore.ps1

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

- Requires :



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



PS C:\\>New-CredentialStore



# Creates a new private CredentialStore









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>New-CredentialStore -Force



# Resets an existing private CredentialStore









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>New-CredentialStore -Shared



# Creates a new shared CredentialStore









-------------------------- EXAMPLE 4 --------------------------



PS C:\\>New-CredentialStore -Shared -Path "C:\\TMP\\CredentialStore.json"



# Creates a new shared CredentialStore in the given location.











RELATED LINKS

https://github.com/OCram85/PSCredentialStore