Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Get-ChildItem Confusing Results

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 ??

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading