0
代碼將不會返回獲取-ADUser便有命令的結果,直到後,我打的代碼結束後回車不顯示結果,直到寫主機和讀主機
Write-Host "Please enter the user account name. Ex. jsmith1" -ForegroundColor Yellow -BackgroundColor Black
$Username = Read-Host
"`n"
Write-Host "Is this the correct username? $Username" -ForegroundColor Yellow -BackgroundColor Black
Write-Host "If Yes Type 1; If No type 2" -ForegroundColor Yellow -BackgroundColor Black
$Continue1 = Read-Host
IF ($Continue1 -eq 1)
{
Get-ADUser -Server "contoso.com" -filter * -Properties * | Where {$_.SamAccountName -match $Username} | Select DisplayName, SamAccountName, EmployeeID, EmployeeNumber
}
ELSE
{}
Write-Host "Would you like to update the Employee ID and the Employee Number?" -ForegroundColor Yellow -BackgroundColor Black
Write-Host "If Yes Type 1; If No type 2" -ForegroundColor Yellow -BackgroundColor Black
$Continue2 = Read-Host
缺少什麼我在這裏?
的可能的複製[無法暫停或睡眠後選擇-對象(https://stackoverflow.com/questions/34835327/unable-to-pause-or-sleep-after-選擇對象) – PetSerAl