I'd like to find a way to append to an outputted csv file in Powershell. Out-File has too much wasted space and duplicate lines. Here's the script I'm trying to run:
$a=Get-Content users.txt
foreach ($i in $a)
{
get-user $i | select displayname,samaccountname | Export-Csv output.csv -notype
}
I can't seem to find anything when dealing with an input file... Thx.
$a=Get-Content users.txt
foreach ($i in $a)
{
get-user $i | select displayname,samaccountname | Export-Csv output.csv -notype
}
I can't seem to find anything when dealing with an input file... Thx.