$TARGET_DIR = "C:\Users\usr160097.GMO\Documents\旧pc\写真\misumi2" |
cd "${TARGET_DIR}" |
$dirs = @{} |
dir ./ | foreach { |
$dir = $_.LastWriteTime.ToString("yyyyMMdd_") |
$dir1 = $TARGET_DIR |
$dir2 = $TARGET_DIR + "\" + $dir |
$file = $_.Name |
if ( $(test-path $dir2) -ne $True ) { |
New-Item $dir2 -itemType Directory | Out-Null |
} |
Move-Item -force "${dir1}\${file}" "${dir2}\${file}" |
#write "${dir2}\${file}" |
元ネタ
https://gist.github.com/waterada/fcec0528888e398a0c6c
0 件のコメント:
コメントを投稿