ebekker / ACMESharp

An ACME client library and PowerShell client for the .NET platform (Let's Encrypt)
https://pkisharp.github.io/ACMESharp-docs/
1.21k stars 184 forks source link

Using Update-ACMEIdentifier with an ID instead of alias #362

Closed isaychenko closed 5 years ago

isaychenko commented 5 years ago

Hello!

I created a new ACME identifier with a command

New-ACMEIdentifier -Dns sd.cleverics.ru

(without optional -Alias param). No I'm trying to set an alias by calling Update-ACMEIdentifier:

Update-ACMEIdentifier -IdentifierRef '717acdba-0054-49ad-b046-57224e9fa0ae' -NewAlias 'MyAlias'

(where GUID is an Id received by Get-ACMEIdentifier cmdlet). However Update-ACMEIdentifier stops with error

Update-ACMEIdentifier : Input string was not in a correct format. At line:1 char:1

How can I properly pass an Id to -IdentifierRef param?

ebekker commented 5 years ago

The ID ref that you've specified is using the alias format, you need to prefix it with an = in order to indicate it's an ID as per this.

So you want to do:

Update-ACMEIdentifier -IdentifierRef '=717acdba-0054-49ad-b046-57224e9fa0ae' -NewAlias 'MyAlias'