Skip to content

Commit 0fe7862

Browse files
authored
Merge pull request Azure#396 from MoimHossain/master
Added a default to notAfter to make it work.
2 parents 9f1007d + f8e35a0 commit 0fe7862

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

docs-conceptual/azureadps-2.0/signing-in-service-principal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ We'll use a self signed certificate for this example, so let's create one. You'l
3333

3434
```powershell
3535
$pwd = "<password>"
36+
$notAfter = (Get-Date).AddMonths(6) # Valid for 6 months
3637
$thumb = (New-SelfSignedCertificate -DnsName "drumkit.onmicrosoft.com" -CertStoreLocation "cert:\LocalMachine\My" -KeyExportPolicy Exportable -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" -NotAfter $notAfter).Thumbprint
3738
$pwd = ConvertTo-SecureString -String $pwd -Force -AsPlainText
3839
Export-PfxCertificate -cert "cert:\localmachine\my\$thumb" -FilePath c:\temp\examplecert.pfx -Password $pwd

0 commit comments

Comments
 (0)