Skip to content

Commit ec493b6

Browse files
authored
Recode Example2 (#15808)
Example 2 throws an error if using PowerShell Core / 7. Code needed a slight change to be valid again, also on PowerShell Core. Tested, does not throw any errors anymore on PS Core.
1 parent 72bcf8a commit ec493b6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Resources/Resources/help/New-AzADAppCredential.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ A new password credential is added to the existing application with object id '1
8787
### Example 2 - Create a new application credential using a certificate
8888

8989
```
90-
PS C:\> $cer = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
91-
PS C:\> $cer.Import("C:\myapp.cer")
90+
PS C:\> $cer = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\myapp.cer")
9291
PS C:\> $binCert = $cer.GetRawCertData()
9392
PS C:\> $credValue = [System.Convert]::ToBase64String($binCert)
9493
PS C:\> New-AzADAppCredential -ApplicationId 4589cd6b-3d79-4bb4-93b8-a0b99f3bfc58 -CertValue $credValue -StartDate $cer.NotBefore -EndDate $cer.NotAfter

0 commit comments

Comments
 (0)