'How to read the values of the 'details' tab of a file system obect's property sheet with powershell
Using Powershell, I want to create script to read various executable's version numbers and name. The info is listed on the details tab of the file's property sheet:
The basic file system object's properties do not seem to list them (using get-member). Also, have reviewed the following StackOverflow suggestions, that were not immediately helpful:
stackoverflow ref1
Stackoverflow ref2
Is it possible to do this with powershell?
Solution 1:[1]
In your case, the .VersionInfo property of the target executable's System.IO.FileInfo instance, as reported by Get-ChildItem or Get-Item, contains the information of interest:
$exeFile = 'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe'
(Get-ChildItem $exeFile).VersionInfo.ProductVersion
To see all available properties:
$exeFile = 'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe'
(Get-ChildItem $exeFile).VersionInfo | Format-List *
Note that a different approach is required if different kinds of properties are to be extracted from files, such as photo-related metadata from image files - see this post.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |

