PowerShell Split after Pipe PowerShell Split after Pipe powershell powershell

PowerShell Split after Pipe


You are almost there. You need to put your code within the Foreach-Object cmdlet:

Get-ChildItem -recurse $folder|    Where-Object {$_.PSIsContainer}|    Select-Object -ExpandProperty FullName |    ForEach-Object {                    $_.Split("\")[3]            }