Skip to content

Commit d2cb6d2

Browse files
authored
Merge pull request #1650 from Styxxy/patch-16
Get-Certificate examples fixes
2 parents ac0bf59 + dbf4f7c commit d2cb6d2

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

docset/windows/pkiclient/Get-Certificate.md

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ Delegation may be required when using this cmdlet with Windows PowerShell® remo
5555
```
5656
PS C:\>$up = Get-Credential
5757
58-
59-
6058
PS C:\>Get-Certificate -Template SslWebServer -DnsName www.contoso.com,www.fabrikam.com -Url https://www.contoso.com/Policy/service.svc -Credential $up -CertStoreLocation cert:\LocalMachine\My
6159
```
6260

@@ -68,9 +66,7 @@ If the request is made pending, then the request is installed in the machine REQ
6866

6967
### EXAMPLE 2
7068
```
71-
PS C:\>$cert = ( Get-ChildItem -Path cert:\LocalMachine\My\EEDEF61D4FF6EDBAAD538BB08CCAADDC3EE28FF )
72-
73-
69+
PS C:\>$cert = Get-ChildItem -Path cert:\LocalMachine\My\EEDEF61D4FF6EDBAAD538BB08CCAADDC3EE28FF
7470
7571
PS C:\>$enrollResult = Get-Certificate -Template SslWebServer -DnsName www.contoso.com -Url https://www.contoso.com/policy/service.svc -Credential $cert -CertStoreLocation cert:\LocalMachine\My
7672
```
@@ -81,9 +77,7 @@ This example submits a certificate request to a specific URL using the certifica
8177
```
8278
PS C:\>Set-Location -Path cert:\LocalMachine\My
8379
84-
85-
86-
PS C:\>$enrollResult = ( Get-Certificate -Template WorkstationTemplate -Url https://www.contoso.com/service.svc )
80+
PS cert:\LocalMachine\My>$enrollResult = Get-Certificate -Template WorkstationTemplate -Url https://www.contoso.com/service.svc
8781
```
8882

8983
This example authenticates the URL using the machine account and Windows integrated authentication and submits a request for a machine certificate of template named WorkstationTemplate.
@@ -92,33 +86,25 @@ This example authenticates the URL using the machine account and Windows integra
9286
```
9387
PS C:\>Set-Location -Path cert:\CurrentUser\My
9488
95-
96-
97-
PS C:\>Get-Certificate -Template User -Url ldap:
89+
PS cert:\CurrentUser\My>Get-Certificate -Template User -Url ldap:
9890
```
9991

10092
This example uses Windows integrated authentication to enroll for a certificate of template User using direct DCOM calls to the CA.
10193

10294
### EXAMPLE 5
10395
```
104-
PS C:\>$request = (Get-ChildItem -Path cert:\LocalMachine\Request\EEDEF61D4FF6EDBAAD538BB08CCAADDC3EE28FF)
105-
106-
96+
PS C:\>$request = Get-ChildItem -Path cert:\LocalMachine\Request\EEDEF61D4FF6EDBAAD538BB08CCAADDC3EE28FF
10797
10898
PS C:\>$up = Get-Credential
10999
110-
111-
112100
PS C:\>Get-Certificate -Request $request -Credential $up
113101
```
114102

115103
This example retrieves and submits a pending request using a user name and password as credentials.
116104

117105
### EXAMPLE 6
118106
```
119-
PS C:\>$request = (Get-ChildItem -Path cert:\LocalMachine\Request\EEDEF61D4FF6EDBAAD538BB08CCAADDC3EE28FF)
120-
121-
107+
PS C:\>$request = Get-ChildItem -Path cert:\LocalMachine\Request\EEDEF61D4FF6EDBAAD538BB08CCAADDC3EE28FF
122108
123109
PS C:\>Get-Certificate -Request $request
124110
```

0 commit comments

Comments
 (0)