16.2. The Certificate Namespace
The certificate namespace contains certificate objects whose names are unique in that namespace. The certificate namespace is exposed as the cert drive.
To navigate to the cert drive from any other Windows PowerShell drive, simply type:
cd cert:
As with other PowerShell drives, ensure you include the final colon character when specifying the desired drive or an error message will be displayed. Once in the cert: drive, you can, as in other Windows PowerShell drives, use the get-childitem cmdlet to explore the content of the drive.
The cert drive has two folders inside it, LocalMachine and CurrentUser. To see those, type the following command when Cert:\ is the current location:
get-childitem
Switch to the CurrentLocation folder using this command:
set-location CurrentUser
or:
cd CurrentUser
then type:
get-childitem
or:
dir
and you will see the second level folders shown in Figure 16-7. Notice the My folder, which is where the certificate you will create later in this chapter will be stored.
Figure 16.7. Figure 16-7
NOTE
When working with the cert drive from the Windows PowerShell command line, be aware that it does not always immediately update with newly created certificates. Opening a new Windows PowerShell command shell causes it to recognize the newly created certificate.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access