我试图写一个简单的do..until循环,它不起作用:
$yesNo = Read-Host -Prompt 'Do you want to add alternative DNS names or IPs into Certificate? Y/N: '
do {
$dnsipname = Read-Host -Prompt "Please input DNS or IP as dns=alternativeCNname or ip=ipName: "
Write-Output "$dnsipname"
$strQuit = Read-Host " do you want to add another DNS? (Y/N)"
do {
$dnsipname = Read-Host -Prompt "Please input DNS or IP as dns=alternativeCNname or ip=ipName: "
Write-Output "$dnsipname"
Add-Content D:\Scripts\expiringCerts\request.inf '`r`n_continue_ = "$dnsipname"'
} until ($strQuit -eq "Y" -or …Run Code Online (Sandbox Code Playgroud) powershell ×1