powershell icon indicating copy to clipboard operation
powershell copied to clipboard

[BUG] New-PnPAzureCertificate: Object reference not set to an instance of an object

Open carolinedpena opened this issue 3 years ago • 5 comments

Reporting an Issue or Missing Feature

Please confirm what it is that your reporting

Expected behavior

Please describe what output you expect to see from the PnP PowerShell Cmdlets Generation of certificate(s)

Actual behavior

Please describe what you see instead. Please provide samples of output or screenshots. Screenshot 2022-12-06 at 11 50 55 AM

Steps to reproduce behavior

Please include complete script or code samples in-line or linked from gists $cert=New-PnPAzureCertificate -OutPfx pnp.pfx -OutCert pnp.cer -CertificatePassword (ConvertTo-SecureString -String "password" -AsPlainText -Force) New-PnPAzureCertificate -OutPfx pnp.pfx -OutCert pnp.cer -CertificatePassword (ConvertTo-SecureString -String "password" -AsPlainText -Force)

What is the version of the Cmdlet module you are running?

(you can retrieve this by executing Get-Module -Name "PnP.PowerShell" -ListAvailable)

Currently using 1.12.26 nightly release: Screenshot 2022-12-06 at 11 53 16 AM

Which operating system/environment are you running PnP PowerShell on?

  • [ ] Windows
  • [ ] Linux
  • [X] MacOS
  • [ ] Azure Cloud Shell
  • [ ] Azure Functions
  • [ ] Other : please specify

carolinedpena avatar Dec 06 '22 16:12 carolinedpena

@carolinedpena It seems to fail on trying to write the certificate to disk. I don't have a Mac so cannot try this out. Can you try specifying a full path to where it should write the certificates to and see if that makes a difference?

KoenZomers avatar Dec 07 '22 10:12 KoenZomers

@KoenZomers - specifying the full path results in the same error message: image

carolinedpena avatar Dec 08 '22 16:12 carolinedpena

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Dec 24 '22 02:12 github-actions[bot]

I have the same issue on my Mac

ollimenzel avatar Jan 11 '23 16:01 ollimenzel

Most likely because MacOS uses forward slashes for paths (not back slashes). And although it throws an error on the second line (with the forward slashes), it still creates the certs in the correct folder, but the first line (back slashes doesn't at all).

image

Closing for now. Feel free to reopen if the certs are not created.

veronicageek avatar Feb 16 '23 17:02 veronicageek