måndag 9 juli 2012

PowerShell - Iterate folders and move items to parent

Get-ChildItem -Recurse | Where {$_.psIsContainer -eq $true} | Select-Object FullName | ForEach-Object {
    Set-Location $_.FullName;
    Move-Item *.* -Destination $loc;
    Set-Location $loc;
}

Inga kommentarer:

Skicka en kommentar