Skip to content

Commit 275af47

Browse files
authored
Update app-only-auth-powershell-v2.md
Make certification creation instructions easier
1 parent 70ad0fd commit 275af47

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

exchange/docs-conceptual/app-only-auth-powershell-v2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ Create a self-signed x.509 certificate using one of the following methods:
149149

150150
```powershell
151151
# Create certificate
152-
New-SelfSignedCertificate -DnsName "example.com" -CertStoreLocation "cert:\LocalMachine\My" -NotAfter (Get-Date).AddYears(1)
152+
$mycert = New-SelfSignedCertificate -DnsName "example.com" -CertStoreLocation "cert:\LocalMachine\My" -NotAfter (Get-Date).AddYears(1)
153153
154154
# Export certificate to .pfx file
155-
Get-ChildItem -Path Cert:\localMachine\my\1DC696D8BE9E656D1F9ED576931B44EC650CF0F8 | Export-PfxCertificate -FilePath mycert.pfx -Password $(ConvertTo-SecureString -String "1234" -Force -AsPlainText)
155+
$mycert | Export-PfxCertificate -FilePath mycert.pfx -Password $(ConvertTo-SecureString -String "1234" -Force -AsPlainText)
156156
157157
# Export certificate to .cer file
158-
Get-ChildItem -Path Cert:\localMachine\my\1DC696D8BE9E656D1F9ED576931B44EC650CF0F8 | Export-Certificate -FilePath mycert.cer
158+
$mycert | Export-Certificate -FilePath mycert.cer
159159
```
160160

161161
- Use the [Create-SelfSignedCertificate script](https://github.com/SharePoint/PnP-Partner-Pack/blob/master/scripts/Create-SelfSignedCertificate.ps1). Note that this script generates SHA1 certificates.

0 commit comments

Comments
 (0)