2022-07-13 08:26:50 +02:00
---
external help file: PSCredentialStore-help.xml
Module Name: PSCredentialStore
schema: 2.0.0
---
2019-04-29 16:05:43 +02:00
# New-CredentialStore
2017-09-28 11:08:41 +02:00
## SYNOPSIS
2019-04-29 16:05:43 +02:00
Creates a new credential store File
2017-09-28 11:08:41 +02:00
## SYNTAX
### Private (Default)
```
2019-04-29 16:05:43 +02:00
New-CredentialStore [-Force] [-PassThru] [-SkipPFXCertCreation] [-UseCertStore] [-WhatIf] [-Confirm]
[< CommonParameters > ]
2017-09-28 11:08:41 +02:00
```
### Shared
```
2019-04-29 16:05:43 +02:00
New-CredentialStore [-Shared] [-Path < FileInfo > ] [-Force] [-PassThru] [-SkipPFXCertCreation] [-UseCertStore]
[-WhatIf] [-Confirm] [< CommonParameters > ]
2017-09-28 11:08:41 +02:00
```
## DESCRIPTION
2019-04-29 16:05:43 +02:00
You need to run this script first to create a new credential store before you try to
save new credentials with New-CredentialStoreItem.
2017-09-28 11:08:41 +02:00
## EXAMPLES
2022-07-13 08:26:50 +02:00
### EXAMPLE 1
2019-04-29 16:05:43 +02:00
```
New-CredentialStore
# Creates a new private CredentialStore
2022-07-13 08:26:50 +02:00
```
2019-04-29 16:05:43 +02:00
2022-07-13 08:26:50 +02:00
### EXAMPLE 2
2019-04-29 16:05:43 +02:00
```
New-CredentialStore -Force
# Resets an existing private CredentialStore
2022-07-13 08:26:50 +02:00
```
2019-04-29 16:05:43 +02:00
2022-07-13 08:26:50 +02:00
### EXAMPLE 3
2017-09-28 11:08:41 +02:00
```
2019-04-29 16:05:43 +02:00
New-CredentialStore -Shared
# Creates a new shared CredentialStore
2022-07-13 08:26:50 +02:00
```
2019-04-29 16:05:43 +02:00
2022-07-13 08:26:50 +02:00
### EXAMPLE 4
2019-04-29 16:05:43 +02:00
```
New-CredentialStore -Shared -Path "C:\TMP\CredentialStore.json"
# Creates a new shared CredentialStore in the given location.
2022-07-13 08:26:50 +02:00
```
2019-04-29 16:05:43 +02:00
2018-03-09 14:02:51 +01:00
## PARAMETERS
2019-04-29 16:05:43 +02:00
### -Force
Use this switch to reset an existing store.
The complete content will be wiped.
2017-09-28 11:08:41 +02:00
```yaml
2019-04-29 16:05:43 +02:00
Type: SwitchParameter
2017-09-28 11:08:41 +02:00
Parameter Sets: (All)
2018-03-09 14:02:51 +01:00
Aliases:
2017-09-28 11:08:41 +02:00
2018-03-09 14:02:51 +01:00
Required: False
2017-09-28 11:08:41 +02:00
Position: Named
2019-04-29 16:05:43 +02:00
Default value: False
2017-09-28 11:08:41 +02:00
Accept pipeline input: False
Accept wildcard characters: False
```
2019-04-29 16:05:43 +02:00
### -PassThru
{{ Fill PassThru Description }}
2017-09-28 11:08:41 +02:00
```yaml
2019-04-29 16:05:43 +02:00
Type: SwitchParameter
Parameter Sets: (All)
2018-03-09 14:02:51 +01:00
Aliases:
2017-09-28 11:08:41 +02:00
Required: False
Position: Named
2019-04-29 16:05:43 +02:00
Default value: False
2017-09-28 11:08:41 +02:00
Accept pipeline input: False
Accept wildcard characters: False
```
2019-04-29 16:05:43 +02:00
### -Path
Define a location for the new shared CredentialStore.
The default store will be created in
$Env:ProgramData\PSCredentialStore dir.
2018-03-21 14:32:32 +01:00
```yaml
2019-04-29 16:05:43 +02:00
Type: FileInfo
Parameter Sets: Shared
2018-03-21 14:32:32 +01:00
Aliases:
2019-04-29 16:05:43 +02:00
Required: False
2018-03-21 14:32:32 +01:00
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2017-09-28 11:08:41 +02:00
### -Shared
2019-04-29 16:05:43 +02:00
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.
2017-09-28 11:08:41 +02:00
```yaml
Type: SwitchParameter
Parameter Sets: Shared
2018-03-09 14:02:51 +01:00
Aliases:
2017-09-28 11:08:41 +02:00
2019-01-16 12:55:29 +01:00
Required: True
2017-09-28 11:08:41 +02:00
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
2019-04-29 16:05:43 +02:00
### -SkipPFXCertCreation
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.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -UseCertStore
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.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2017-09-28 11:08:41 +02:00
### CommonParameters
2019-04-29 16:05:43 +02:00
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters ](http://go.microsoft.com/fwlink/?LinkID=113216 ).
2017-09-28 11:08:41 +02:00
## INPUTS
### [None]
## OUTPUTS
2019-04-29 16:05:43 +02:00
### ['PSCredentialStore.Store'] Returns the recently created CredentialStore object if the -PassThru parameter
### was given.
2017-09-28 11:08:41 +02:00
## NOTES
## RELATED LINKS