Newb here, maybe some of my questions can help other newbs...
Starting with some code I found here to help automate the process.
if (!(Get-Module "ACMESharp")) {
# module is not loaded
Install-Module -Name ACMESharp -AllowClobber -Scope CurrentUser
}
If (!(Get-module ACMESharp )) {
Import-Module ACMESharp
}
## I already had my-vault defines
Register-FQDN("video.mydomain.com")
function Register-FQDN
{
$FQDN = $args[0]
19 echo "`n Creating a new identifier for $FQDN ..."
20 echo "`n $FQDN"
21 New-ACMEIdentifier -VaultProfile my-vault -Dns $FQDN -Alias $FQDN | select status, Expires
22 Get-ACMEIdentifier -VaultProfile my-vault -IdentifierRef $FQDN
echo "`n Completing the challenge for the new identifier for $FQDN ..."
$challenge = Complete-ACMEChallenge $FQDN -Verbose -Regenerate -ChallengeType http-01 -Handler manual -HandlerParameters @{WriteOutPath = 'c:\Users\me\inst.txt'} #| select Identifier, status, Expires *>&1 >> $acmelog
$rec = ($challenge.Challenges | Where-Object {$_.type -eq "dns-01"}).challenge.recordname
$data = ($challenge.Challenges | Where-Object {$_.type -eq "dns-01"}).challenge.recordvalue
.
.
I have a breakpoint set on line 22 and when I execute the line I am getting an error on the "
Get-ACMEIdentifier -VaultProfile my-vault -IdentifierRef $FQDN
" line with the following error
Get-DnsServerZone : The term 'Get-DnsServerZone' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\me\Documents\LetsEncrypt2.ps1:52 char:14
+ while ((Get-DnsServerZone -ComputerName $dnsserver | Where-Obje ...
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-DnsServerZone:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
What is troubling me is that I don't even know why the script is executing down in line 52 which was from the previous author who was using dns records for verification. I'm trying to use http-01 method. Where is the execution call to the erroneous "Get-DnsServerZone" coming from. I don't even see that???
Thanks
Joe