Thursday, 2 August 2012

How to import file using Powershell

How to Import the file using powershell

Declare the variable to load CSV file.

C:\temp>$V = import-csv c:\reprot.txt

If you want to see the ouput in console , just type the $v variable, you will be shown with  content loaded into the text file

Then we have run the script line by line, so we must use foreach alias

$v | foreach {
$_.hide –eq “yes”
Write-host  “ $ will be set as $true”