Advertisement
Guest User

NAS-Search

a guest
Apr 18th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $SUB = '101010'
  2. $file = get-item "\\SERVER\PIC*" -Exclude *dev*, *nic*
  3. $list = $file.FullName
  4. $say = ForEach ( $l in $list ){ Get-ChildItem $l -Depth 0 |
  5.     Where-Object { $_.PSIsContainer -and $_ -match $SUB |
  6.     select $_.FullName }
  7.      }
  8. $SUBloc = $say.FullName
  9.  
  10. cls
  11.  
  12. foreach ($s in $SUBloc){
  13. Write-host "Copying... $s\R to $s\L"
  14. Copy-Item "$s\R\*" -Destination "$s\L\"
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement