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