Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #PS C:\Windows\system32> c:\Users\admin\Desktop\123\hello.ps1 -c "5" -p1 "c:\Users\admin\Desktop\123\" -p2 "c:\Users\admin\Desktop\123\1\"
  2. param ([string]$c, [string]$p1, [string]$p2)
  3. New-Item -Path $p2 -ItemType 'Directory' -Force #create directory
  4. Get-ChildItem -Path $p1 | Where-Object {$_ -match "[$c-9]"} | Foreach-Object {Join-Path -Path $p1 -ChildPath $_} | Foreach-Object {Copy-Item -Path $_ -Destination $p2}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement