Version in file name

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

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 1 year and 2 months 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.
Locked
chris_shaw
Posts: 1
Last visit: Sun Jan 29, 2023 5:42 pm

Version in file name

Post by chris_shaw »

Hi,

When creating an exe in PowerShell Studio, I'm trying to get the version number put in the file name so I don't overwrite old versions. Anyone know how you can do this.

Thanks.
exeversion.PNG
exeversion.PNG (5.37 KiB) Viewed 459 times
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Version in file name

Post by Alexander Riedel »

Use a name of Exename.xx.xx.xx
Create a post- build script that retrieves the version number of Exename.xx.xx.xx.exe
and renames the file.
(Get-Command "Exename.xx.xx.xx.exe").FileVersionInfo.FileVersion
will retrieve the version number.
You can take it from there.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 1 year and 2 months 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.
Locked