Now that you know what I'm after, let me show you what I've done. With this small little function below, I can quickly get all the required information in no time. How do I use it? You can use it either via pipeline from Get-ChildItem or by providing full path inputs to it.
# Option 1
Get-ChildItem -Path $Env:USERPROFILE\Desktop -Force | Get-FileMetaData -Signature | Out-HtmlView -ScrollX -Filtering -AllProperties
# Option 2
$Files = "$Env:USERPROFILE\Desktop\LAPS.x64.msi", "$Env:USERPROFILE\Desktop\DigiCertUtil.exe"
$Files | Get-FileMetaData -Signature | Out-HtmlView -ScrollX -Filtering -AllProperties
# Option 3
Get-FileMetaData -File $Files | Out-HtmlView -ScrollX -Filtering -AllProperties
# Option 4
Get-ChildItem -Path $Env:USERPROFILE\Desktop -Force | Where-Object { $_.Attributes -like '*Hidden*' } | Get-FileMetaData -Signature | Out-HtmlView -ScrollX -Filtering -AllProperties
This function has two parameters (for now) – one taking [System.IO.DirectoryInfo] (basically Get-ChildItem output) or [string], the other one is a switch deciding whether you want to check if the file is signed or not.
The output you see above is only output from two files. I'm specifically using the PSWriteHTML Out-HtmlView command with the ScrollX parameter to make sure it shows everything that there is to show. Additionally, please notice I'm using AllProperties switch. This switch is special when it comes to Out-HtmlView. This is because most of the commands such as Format-Table or Export-CSV or even Out-HtmlView, by default, display properties only from 1st entry in the array. It's efficient and fast. However, in the case of Get-FileMetaData, where each file has different properties it doesn't make much sense. Using AllProperties does a “prescan” of an Array, and then any property missing from 1st element is added so that Out-HtmlView can display everything there is to show. Of course, if you're working with the same file types that don't differ from each other, you can skip that parameter or Out-HtmlView for that matter.
If you just want to peek into an object quickly, you can use Format-List * to see all parameters without using Out-HtmlView.
If you intend to use Out-HtmlView for this, please make sure to install it first. You can do so using Install-Module
Ok, so now that you know what you're getting into, there are two ways to get Get-FileMetaData function. Copy and paste from the source below or install one of my “do it all” modules called PSSharedGoods. I use the PSSharedGoods module as my glue module where multiple other modules use it as a dependency, or I copy the functions from it during build time and convert them to private services within other modules to minimize dependencies.
Keep in mind that I update my modules quite often, fixing bugs, so always up to date versions of said modules can be downloaded from PowerShellGallery using Install-Module, as mentioned above. When I push my modules into PowerShellGallery, I minimize them and optimize them for production use. If you're into development and want to work in a more structured way where each function has separate files, multiple folders, and so on, I would highly recommend visiting my GitHub pages for PSWriteHTML or PSSharedGoods.