Home > Blockchain >  Get-ChildItem Confusing Results
Get-ChildItem Confusing Results

Time:04-09

I'm running Get-ChildItem but its returning TWO results which is confusing me ... why ?

Get-ChildItem "$env:ProgramFiles\Google\Drive File Stream\" -Filter 'GoogleDriveFS.exe' -Recurse

here's the output:

  Directory: C:\Program Files\Google\Drive File Stream\56.0.11.0


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         3/30/2022  11:38 AM       53664656 GoogleDriveFS.exe


    Directory: C:\Program Files\Google\Drive File Stream\56.0.9.0


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         3/24/2022   8:02 AM       53662040 GoogleDriveFS.exe

Surely I'm not running two separate versions of googleDrive ??

CodePudding user response:

You used the -Recurse switch and it found multiple files by the same name in subfolders of the tree you ran Get-ChildItem from. -Recurse will recursively check inside other containers, which since you're using the FileSystem provider, means it will recursively look in nested directories.

We can't tell you why there are two and this isn't the community to ask about it (hint: try asking on Super User). But Get-ChildItem -Recurse is telling you exactly what you've asked of it: recursively search for GoogleDriveFS.exe in subdirectories of $env:ProgramFiles\Google\Drive File Stream.

  • Related