Passing EXE's Build Info to script to display in write-host

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 11 months and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
brett_cherwinski
Posts: 1
Last visit: Mon Feb 05, 2024 8:47 am

Passing EXE's Build Info to script to display in write-host

Post by brett_cherwinski »

Product, version and build: 5.8.219
Operating system: Windows 10
PowerShell version(s): 5.1
Output: EXE

How do I pass the "Product Version" generated in the Packager (with auto increment), to my powershell script so it displays my current build in a Write-Host command?
To be clear, this only needs to be passed during the build process. The script, that this runs, builds an output file, that I want to include the version number with, so when the output files are collected over time, I know which version of the EXE was used.
User avatar
brittneyr
Site Admin
Posts: 1654
Last visit: Wed Mar 27, 2024 1:54 pm
Answers: 39
Been upvoted: 30 times

Re: Passing EXE's Build Info to script to display in write-host

Post by brittneyr »

You can get the product version information for a running packaged executable from the following line:
  1. [System.Windows.Forms.Application]::ProductVersion

If you are not running the packaged executable, you can get the product version from the exe file.
The following may be helpful:
https://stackoverflow.com/questions/306 ... powershell
Brittney
SAPIEN Technologies, Inc.
This topic is 11 months and 1 week old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.