< Back

Get-CCertificateStore

Sun Jan 12, 2020 9:34 pm

NAME Get-CCertificateStore



SYNOPSIS

Gets an `X509CertificateStore` object for the given location and store name.





SYNTAX

Get-CCertificateStore -StoreLocation {CurrentUser | LocalMachine} -StoreName {AddressBook | AuthRoot |

CertificateAuthority | Disallowed | My | Root | TrustedPeople | TrustedPublisher} [<CommonParameters>]



Get-CCertificateStore -StoreLocation {CurrentUser | LocalMachine} -CustomStoreName <String> [<CommonParameters>]





DESCRIPTION

Returns an `X509Store` for a given store location and store name. The store must exist. Before being retured, it

is opened for writing. If you don't have permission to write to the store, you'll get an error.



If you just want to read a store, we recommend using PowerShell's `cert:` drive.





PARAMETERS

-StoreLocation

The location of the certificate store to get.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-StoreName

The name of the certificate store to get.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-CustomStoreName <String>

The name of the non-standard certificate store to get. Use this to pull certificates from a non-standard store.



Required? true

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



OUTPUTS

Security.Cryptography.X509Certificates.X509Store.





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



PS C:\\>Get-CCertificateStore -StoreLocation LocalMachine -StoreName My



Get the local computer's Personal certificate store.









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



PS C:\\>Get-CCertificateStore -StoreLocation CurrentUser -StoreName Root



Get the current user's Trusted Root Certification Authorities certificate store.











RELATED LINKS