Created
April 13, 2015 08:49
-
-
Save kayasax/17534a2af61c75f3cdc2 to your computer and use it in GitHub Desktop.
powershell Array collection to CSV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$col=@() | |
#... | |
# instead adding an hashtable to the collection, we convert it to psobject | |
$prop=@{"serveur"="$computername";"nom"="$n";"programme"="$p";"arguments"="$a"; "xml"="$x"} | |
$col+= new-object -type pscustomobject -property $prop | |
#this allow us to export data to csv | |
$r |select serveur,nom,programme, arguments,xml |export-csv -path c:\temp\tasks.csv -notype -delimiter ';' -append |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment