Skip to content

Instantly share code, notes, and snippets.

@Gnimuc
Last active April 25, 2022 08:04
Show Gist options
  • Save Gnimuc/5caef5c8b8bc6545a428e0c0452f4de2 to your computer and use it in GitHub Desktop.
Save Gnimuc/5caef5c8b8bc6545a428e0c0452f4de2 to your computer and use it in GitHub Desktop.
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