Skip to content

Commit 697749a

Browse files
authored
Update import-pfxcertificate.md
Using Get-Credential over ConvertTo-SecureString stops plain text passwords from being saved in the console history. Additionally the CertStoreLocation parameter was missing.
1 parent b0b8261 commit 697749a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docset/windows/pkiclient/import-pfxcertificate.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ Delegation may be required when using this cmdlet with Windows PowerShell® remo
3939

4040
### EXAMPLE 1
4141
```
42-
PS C:\>$mypwd = ConvertTo-SecureString -String "1234" -Force -AsPlainText
42+
PS C:\>$mypwd = Get-Credential -UserName 'Enter password below' -Message 'Enter password below'
4343
4444
4545
46-
PS C:\>Import-PfxCertificate -FilePath C:\mypfx.pfx cert:\localMachine\my -Password $mypwd
46+
PS C:\>Import-PfxCertificate -FilePath C:\mypfx.pfx -CertStoreLocation Cert:\LocalMachine\My -Password $mypwd.Password
4747
```
4848

4949
This example imports the PFX file my.pfx with a private non-exportable key into the My store for the machine account.

0 commit comments

Comments
 (0)