Is there a way for a service created with PowerShell Studio to get its own version number?
For an EXE created with PowerShell Studio, I've done something like:
$MyVer=[System.Diagnostics.FileVersionInfo]::GetVersionInfo($MyExe).FileVersion
but that's really collecting it from the EXE file, which I don't think will work for a service.
I thought there might be a property on the running service through Get-Service, but no property seems suitable.
Any ideas how a running service created with PowerShell Studio can get its own version number?
Thanks,
Andy
Service Getting Its Own Version?
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.
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.
- andycarpenter@westat.com
- Posts: 17
- Last visit: Thu Jan 07, 2021 1:24 pm
Re: Service Getting Its Own Version?
Applications have no concept of version internally. A version is an arbitrary number that is applied to code when it is packaged. The versioning system in Windows is attached to the executable and has multiple components. "FileVersion""ProductVersion" and other tags.
- Alexander Riedel
- Posts: 7611
- Last visit: Mon Mar 08, 2021 4:28 pm
- Been upvoted: 6 times
Re: Service Getting Its Own Version?
The version for a service is specified when packaging, just as for any other executable. Since a service is an exe, it works just the same way.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- andycarpenter@westat.com
- Posts: 17
- Last visit: Thu Jan 07, 2021 1:24 pm
Re: Service Getting Its Own Version?
Thank you very much for the clarification.Alexander Riedel wrote: ↑Wed Jul 15, 2020 11:15 amThe version for a service is specified when packaging, just as for any other executable. Since a service is an exe, it works just the same way.
Re: Service Getting Its Own Version?
Thank you very much for the help.Alexander Riedel wrote: ↑Wed Jul 15, 2020 11:15 amThe version for a service is specified when packaging, just as for any other executable. Since a service is an exe, it works just the same way.