So, I am still new to writing my own scripts and am trying to search a network drive against a list of folder names for the folders that are on the list but NOT in the network drive. Because the list of names is long, I am thinking that importing a .csv is my best way forward and importing the list to the code.
This is the code I have made so far, now; it is not working (hence asking this question) but I am stumped as to if I am just completely off kilter on my script or if I am close, but it is a syntax issue of some kind. Any help to point me in the right direction is welcome.
$Folders = Import-Csv "path for csv"
$FolderReport =
foreach ($Folder in $Folders) {
$name = $Folder.Name
Get-Childitem -Path "Network Drive" -recurse -include {Name -eq $name}
}
$FolderReport |
export-csv 'Where it's written to' -NoTypeInformation -Force
Start 'opening the file'