Last active
April 3, 2018 17:36
-
-
Save telfaria/2d6b69bcb89e52883f59de75b850989f to your computer and use it in GitHub Desktop.
フォルダ名からタイトルを検索して移動するPowerShellスクリプト
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
| $Folders = Get-ChildItem * | Where-Object { $_.PSIsContainer} | |
| foreach($dName in $Folders) | |
| { | |
| echo "Search: $dName" | |
| $title = $dname.Name | |
| $targerfiles = Get-ChildItem *.MP4 | |
| foreach($file in $targerfiles) | |
| { | |
| if ($file.Name -like "*$title*") | |
| { | |
| Move-Item -LiteralPath $file.name -Destination $dname.FullName -Verbose | |
| } | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
詳細はこちら
http://d.hatena.ne.jp/elfaria/20180309