The directory structure is as follows:
Directory: \\L04274\C$\Temp Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 3/12/2018 2:04 PM AutomatedImportProcess d----- 3/13/2018 11:34 AM f1 d----- 3/13/2018 11:33 AM f2
the exclusion CSV file contains one column (later might be extended to two columns which includes file types as well).
ExcludeDirectory \\L04274\C$\Temp\f2\ \\L04274\C$\Temp\f1\
The PowerShell command looks like this but it does not seem to be doing what is expected:
$path = '\\L04274\C$\Temp\f1'
$exclusion = @(Get-Content -LiteralPath '\\L04274\C$\Temp\Exclusions.csv')
Get-ChildItem -Path $path -Force -Exclude $exclusion
What I expect to see is only the following folder:
\\L04274\C$\Temp\AutomatedImportProcess\