Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Desination = "C:\dest\"
- $Source = "C:\move\"
- $action = $false
- $AFiles = gc "filelist.txt"
- $files = Get-ChildItem -Recurse -Filter *.txt -Path $Source -Exclude "filelist.txt"
- foreach ($file in $files)
- {
- write-host "Checking:" $file
- if ($AFiles.Contains($file.name))
- {
- write-host $file.FullName "in list"
- if ($action)
- {
- move-item -Force -path $file.FullName -Destination $Desination
- }
- }
- else {
- write-host $file.FullName "not in list, will skip."
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement