Guest User

Untitled

a guest
Jan 20th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. Get-ChildItem -Path "\REMOTESERVERDataFiles" -Filter "*.journal" |
  2. Where-Object { $_.Name -match 'Daily_Reviews[d{1,12}-d{1,12}].journal' } |
  3. Sort-Object -Property CreationTime | ForEach-Object
  4. {
  5.  
  6. $sourcefile = $_.Name
  7. [...]
  8.  
  9.  
  10. }
  11.  
  12. $username = 'domainusername'
  13. $password = 'secret'
  14.  
  15. $password = $password | ConvertTo-SecureString -AsPlainText -Force
  16.  
  17. $credential = New-Object System.Management.Automation.PSCredential($username, $password)
  18.  
  19. New-PSDrive -Name journals -PSProvider FileSystem -Root '\remoteserverdatafiles' -Credential $credential | ForEach-Object { Set-Location "$_`:" }
  20.  
  21. Get-ChildItem -Filter "*.journal"
Add Comment
Please, Sign In to add comment