PowerShell on MaxOs versionInfo is empty

74 views Asked by At

I need to get the versionInfo of a windows executable with a Python script running on MacOS. Since Winapi is not available on MacOS, I found that the way to do is via powershell commands. Installed it via brew as described here. pwsh is running after that.

using Get-Item or Get-ItemProperty with the exe on MacOS does return a value but the ProductionVersion and FileVersion are empty:

PS /Users/test>$m = Get-Item /Users/test/test.exe       
PS /Users/test>echo  $m                                                                                                

    Directory: /Users/test

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-----          04/29/2021    14:14        1045616 test.exe

PS /Users/test> $m.VersionInfo

ProductVersion   FileVersion      FileName
--------------   -----------      --------
                                 /Users/test/test.exe

running the same command on the same file on Windows does return both values.

What am I doing wrong? Is there an alternative for using winapi on MacOS to work with win exe?

0

There are 0 answers