Last active
April 12, 2019 03:37
-
-
Save AutomateAaron/53216386cb1f0bdc3680c45d03f631b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$from = "C:\Users\aaron" | |
$to = "D:" | |
$arr = @("Documents","Downloads","Music","Pictures","Videos","Projects") | |
$map = @{} | |
$map.add("Desktop", "desktop-windows") | |
foreach($item in $arr) | |
{ | |
$map.add($item, $item.ToLower()) | |
} | |
foreach($key in $map.keys) | |
{ | |
New-Item -ItemType Directory -Force -Path $to\$($map[$key]) | |
Get-ChildItem -Path $from\$key\* -Recurse -File | Move-Item -Destination $to\$($map[$key]) | |
Remove-Item -Recurse -Force $from\$key | |
cmd /c mklink /D $from\$key $to\$($map[$key]) | |
} | |
Write-Output $to\$($map[$key]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment