Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Get-ChildItem -Path "\REMOTESERVERDataFiles" -Filter "*.journal" |
- Where-Object { $_.Name -match 'Daily_Reviews[d{1,12}-d{1,12}].journal' } |
- Sort-Object -Property CreationTime | ForEach-Object
- {
- $sourcefile = $_.Name
- [...]
- }
- $username = 'domainusername'
- $password = 'secret'
- $password = $password | ConvertTo-SecureString -AsPlainText -Force
- $credential = New-Object System.Management.Automation.PSCredential($username, $password)
- New-PSDrive -Name journals -PSProvider FileSystem -Root '\remoteserverdatafiles' -Credential $credential | ForEach-Object { Set-Location "$_`:" }
- Get-ChildItem -Filter "*.journal"
Add Comment
Please, Sign In to add comment