Last active
April 25, 2022 08:04
-
-
Save Gnimuc/5caef5c8b8bc6545a428e0c0452f4de2 to your computer and use it in GitHub Desktop.
This file contains 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
param ( | |
[string]$destiny = "../folder", | |
[string]$prefix = "./" | |
) | |
foreach ($i in Get-ChildItem -Path $prefix -Recurse) | |
{ | |
Get-Content "input.txt" | Foreach-Object{ | |
if ($i.Name -match "^$_.*[a-zA-Z]{3}$") | |
{ | |
Write-Output "copy-pasting $($i.FullName) to $destiny" | |
Copy-Item -Path $i.FullName -Destination $destiny | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment