我希望从以下代码段输出作为文本文件。我该如何做到这一点?
$users = Import-Csv Y:\Temp\list2.csv
foreach ($user in $users) {
Get-QADUser -lastname $user.lastname -firstname $user.firstname | select firstname,lastname,mobile,primarysmtpaddress,logonname
}
答案 0 :(得分:1)
Import-Csv Y:\Temp\list2.csv | foreach {
Get-QADUser -lastname $_.lastname -firstname $_.firstname | select firstname,lastname,mobile,primarysmtpaddress,logonname
} | Export-Csv c:\list3.csv