I'm not getting any result from user's input.. but this message: Get-ADUser : Cannot validate argument on parameter 'Identity'
My apologies, I'm just a starter in PS. what am I doing wrong here? I'm trying to get the input from the user in to the Get-ADUser -Identity $Username but it seems that it's not taking the input..
function Show-Menu {
param (
[string]$Title = 'UserInfo V3.1'
)
Write-Host "Enter the user ID: " -ForegroundColor Cyan -NoNewline
$UserName = Read-Host
Write-Host ""
Write-Host "================ $Title ================"
Write-Host "Press 'U' for general user info."
Write-Host "Press 'P' for account and password information."
Write-Host "Press 'C' for computer info."
Write-Host "Press 'G' for Virtual Applications (AVC)."
write-Host "Press 'S' for SNOW info details"
Write-Host "Press 'Q' to Quit."
write-Host "=============================================="
}
do
{
Show-Menu
$Selection = Read-Host "Please make a selection"
switch ($Selection)
{
'U' {Get-ADUser -Identity $Username}
}
Pause
}
until ($Input -eq 'q')