I'm using Powershell 5 to search a folder for the most recent .bak file.
Get-ChildItem -Path $SourceBackupPath -Filter *.bak
This works fine if I pass in "C:\temp\"
but if I pass in "E:\temp\"
, I get the error:
Get-ChildItem : Cannot find drive. A drive with the name 'E' does not exist.
If I pass in a UNC path "\\MyServer\e$\Temp\"
I get the error:
Get-ChildItem : Cannot call method. The provider does not support the use of filters.