ACMESharp icon indicating copy to clipboard operation
ACMESharp copied to clipboard

Get-AcmeRegistration throws terminating error and does not respect ErrorAction

Open sdecker opened this issue 7 years ago • 4 comments

I believe it should return null but at the very least it must respect ErrorAction SilentlyContinue. The fact that I must put a try/catch around it determine if i need to do New-AcmeRegistration is wrong

sdecker avatar Mar 15 '17 20:03 sdecker

PS C:\Users\bcadroot> if (-not (Get-AcmeRegistration -ErrorAction SilentlyContinue) ) {New-ACMERegistration -Contacts "mailto:$email" -AcceptTos} Get-AcmeRegistration : No registrations found At line:1 char:11

  • if (-not (Get-AcmeRegistration -ErrorAction SilentlyContinue) ) {New- ...
  •       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Get-ACMERegistration], InvalidOperationException
    • FullyQualifiedErrorId : System.InvalidOperationException,ACMESharp.POSH.GetRegistration

sdecker avatar Mar 15 '17 20:03 sdecker

I think the error might be your Contacts Parameter, for my uses i never use the "mailto:" prefix to my email address. I know on the Wiki it shows it this way, but i just do plain and simple [email protected] and it works just fine. Try it out, and see if it works for you.

animetauren avatar Mar 20 '17 13:03 animetauren

Just a "me too":

PS C:\Users\dave\Desktop> $acmeReg = Get-ACMERegistration -ErrorAction SilentlyContinue Get-ACMERegistration : No registrations found At line:1 char:12

  • $acmeReg = Get-ACMERegistration -ErrorAction SilentlyContinue
  •        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Get-ACMERegistration], InvalidOperationException
    • FullyQualifiedErrorId : System.InvalidOperationException,ACMESharp.POSH.GetRegistration

davehope avatar Jul 21 '17 07:07 davehope

Looks like @VitaliHarbiankou is taking care of this request in #261.

ebekker avatar Aug 02 '17 10:08 ebekker