Hello
I am generating a CSV of list of files and folders for selected path. I created following script and it is working correctly.
$Eliminate = @("*.docx","*.xlsx") $Include = @("*.pptx","*.txt") $AllFiles = @() foreach ($file in get-childitem $FolderPath -recurse -Exclude $Eliminate -Include $Include| Select-Object FullName, Root, Directory, Parent, Name, Extension, PSIsContainer, IsReadOnly, Length, CreationTime, LastAccessTime, LastWriteTime, Attributes) { ... } $AllFiles |Export-Csv $report –NoTypeInformation
Now I have following questions
How can I pass as input parameter for Include and Exclude?
Secondly When I am using Include, it is working correctly but it is skipping the folder of Include variable values.
Please advise how can I achieve this?