In PowerShell v2, la seguente riga: 1..3| foreach { Write-Host "Value : $_"; $_ }| select -First 1
mostrerà: Value : 1
1
Value : 2
Value : 3
Dal momento che tutti gli elementi sono stati spinti
Ho un po 'di codice che assomiglia a questo: if (Get-ADUser $DN -EA SilentlyContinue) {
# Exists
} else {
# Doesn't Exist
}
Purtroppo, quando Get-ADUser il DN non riesce a trovare un ute