Execute following script to insert data in new or existing CSV file.
$FilePath = "D:\Data\FileName,csv"
#Add Title Row
$Row = "Full Name,Age,Gender"
Add-Content ($Row)
-Path $FilePath
#Add Data Row
$Name = "Prashant"
$Age = "29"
$Gender = "Male"
$Row = $Name + "," +
$Age +
"," +
$Gender
Add-Content ($Row)
-Path $FilePath
No comments:
Post a Comment