Get-ChildItem with specific properties, but still grouped by (sub)folder

I have written this bit of PowerShell code to get a listing of files meeting the type criteria shown below: Get-ChildItem -Path ‘C:\Program Files\Common Files’ -Recurse -Include *.exe, *.bat, *.com, *.cmd, *.dll This is part of the result: Directory: C:\Program Files\Common Files\VMware\Drivers\vmci\sockets\Win8 Mode LastWriteTime Length Name —- ————- —— —- -a—- 10/23/2022 12:23 AM 31120… Read More Get-ChildItem with specific properties, but still grouped by (sub)folder

PowerShell GetChildItem exclude file type in base folder but include same file type from sub folder

I’m trying to find a method of getting GetChildItem to include all .xml files found in subfolders, but exclude the .xml files found in the base folder. My folder structure looks like this: MySubFolder\IncludeThis.xml MySubFolder\AlsoIncludeThis.xml AnotherSubFolder\IncludeThis.xml AnotherSubFolder\AlsoIncludeThis.xml ExcludeThis.xml AlsoExcludeThis.xml I’ve tried using -Include and -Exclude arguments, without any luck, as these arguments seem to only… Read More PowerShell GetChildItem exclude file type in base folder but include same file type from sub folder

Saving various files in different folders into one single folder using powershell

I have a 3 folders here with 3 files. Within each there is a csv file, I want to save them all into a destination folder without having to open each folder and drag and drop the file into the destination folder. I attempted this. $destination = "C:\Desktop\Test" $sourcefiles = get-childitem -recurse foreach ($file in… Read More Saving various files in different folders into one single folder using powershell

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 —- ————-… Read More Get-ChildItem Confusing Results