cut powershell 1

cut powershell

Get-Content $filename | ForEach-Object {
    $_.split(":")
}

Here is what the above code is Doing:
1. We’re using the Get-Content cmdlet to read the contents of the file.
2. We’re using the ForEach-Object cmdlet to loop through each line of the file.
3. We’re using the split method to split each line into an array of strings.
4. We’re using the $_ automatic variable to represent the current line of the file.

Similar Posts