Need an idea on how to start (Solved!)

Hi,

I have a list of fullnames of some folders, somehting like:
C:\Temp
C:\Temp\1
C:\Universal
C:\Windows

And I have another list showing only some of those folders which I have access to:
C:\Univeral
C:\Windows

I wanted to create a table like this:

Folders           Visible
_______           _______
C:\Temp            
C:\Temp\1          
C:\Universal      X
C:\Windows        X

But I’m lost on how to start that…

Hi Vandrey,

I think something like this should get you close – note: it is untested code

$AllFolders = Get-Content -Path C:\Temp\AllFolders.txt
$CheckFolders = Get-Content -Path C:\Temp\CheckFolders.txt

foreach ($f in $AllFolders)
{
    [pscustomobject]@{
        Folder  = $f
        Visible = $f -in $CheckFolders
    }
}

HTH,
Steve

How about using Compare-Object?

stephenmbell,

Great! Thanks a lot! Sorry for not replying sooner, it was a big holiday here in Brazil.