Difference between revisions of "Reading a file"

From MyWiki
Jump to: navigation, search
Line 6: Line 6:
 
     }
 
     }
  
<source lang="html4strict">  
+
<source lang="powershell">  
 
$lines=Get-Content myfile.txt
 
$lines=Get-Content myfile.txt
 
     $lines |
 
     $lines |

Revision as of 15:00, 21 October 2014

 
$lines=Get-Content myfile.txt
    $lines |
     ForEach-Object{
         Test-Connection  $_.Split(' ')[1]
     }
 
<source lang="powershell"> 
$lines=Get-Content myfile.txt
    $lines |
     ForEach-Object{
         Write-Host  $_
     }

http://technet.microsoft.com/en-us/library/ee692806.aspx Reading particular lines from a file