Directory and File Report
clear-Host
$Directory = “D:\DATA\DESKTOP*”
Get-ChildItem -path $Directory -Recurse | Out-File c:\Temp\test2.txt
Clear-Host
$Directory = “D:\Data\Desktop*”
Get-ChildItem -path $Directory -Recurse -Include *.exe | Out-File c:\Temp\test2.txt
Clear-Host
$Directory = “D:\Data\Desktop*”
Get-ChildItem -path $Directory -Recurse -Include *.exe `
| Sort-Object Name | Format-Table Name, Fullname -auto | Out-File c:\Temp\test2.txt
Clear-Host
$Directory = “D:\Data\Desktop*”
Get-ChildItem -path $Directory -Recurse -Include *.exe `
| Sort-Object Name | Format-List Name, Fullname
Clear-Host
$Path = “D:\DATA\Desktop*”
Get-Childitem $Path -Recurse | where {$_.Extension -Match “exe”}`
| ft -group {$_.Path} Directory, Name -autosize
Clear-Host
$Path = “D:\Data\Desktop\*.exe”
$WinExe = Get-ChildItem $Path -Recurse
$WinExe.count