Module Version Property

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 4 years and 5 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.
User avatar
PsCustomObject
Posts: 137
Last visit: Thu Mar 28, 2024 3:34 am

Module Version Property

Post by PsCustomObject »

Product, version and build: PowerShell Studio 5.6.163.0
32 or 64 bit version of product: 64bit
Operating system: Win 10 1903
32 or 64 bit OS: 64bit

Hello,

as per subject I'm developing module and just noticed something, maybe I am missing something here, weird regarding the Module version property.

As you can see in the editor's GUI it is reporting as 0.0.0.0 (sorry had to obfuscate some parts but relevant data is there):
ModuleVersion.png
ModuleVersion.png (7.81 KiB) Viewed 4725 times
Despite module version is correctly declared in my module manifest:
ModuleManifest.png
ModuleManifest.png (13.59 KiB) Viewed 4725 times
Now if I try to force version in the GUI I will end up with the following in my manifest
Duplicate Manifest.png
Duplicate Manifest.png (11.29 KiB) Viewed 4725 times
Is this behavior by design? I was expecting editor to source module version directly from ModuleVersion statement in the manifest and not create a duplicate entry in the manifes as shown in the images.

Thansk in advance for any pointer.
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 1:00 pm
Answers: 39
Been upvoted: 30 times

Re: Module Version Property

Post by brittneyr »

Does the ModuleVersion in the Properties panel update if you save the file, close it, and then open it again?
The ModuleVersion does not immediately update when editing it from the editor.

Also, if you edit ModuleVersion in the Properties panel, does it update your file?
Brittney
SAPIEN Technologies, Inc.
User avatar
PsCustomObject
Posts: 137
Last visit: Thu Mar 28, 2024 3:34 am

Re: Module Version Property

Post by PsCustomObject »

Hello Brittney,

if I do update the module version thruogh the properties panel it will add lines to my manifest like this:

Code: Select all

# Added lines
@{
	ModuleVersion = x.x.x.x
}

# Existing text in module manifest
@{
	# Script module or binary module file associated with this manifest
	RootModule			   = 'Module.psm1'
	
	# Version number of this module.
	ModuleVersion		   = '1.1.0.1'
	
	<snip>
}
And even closing/restarting the editor has no effect in the version reported in the Properties panel it is like what's written in the manifest, generated by New Module Project by the way, is ignored as it is always reported as 0.0.0.0 unless I manually modify it causing what I described above.

Thanks!
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 1:00 pm
Answers: 39
Been upvoted: 30 times

Re: Module Version Property

Post by brittneyr »

I have been able to reproduce your problem and have filed an internal bug report.
I was only able to replicate the issue when I removed the default comments at the top of the psd1 file, saved, and then tried to edit the ModuleVersion again. Adding a comment to the top of the file or moving the manifest text down from the first line of the document and saving seemed to resolve the issue for me.
When I have more information to share, I'll post it here.
Brittney
SAPIEN Technologies, Inc.
User avatar
PsCustomObject
Posts: 137
Last visit: Thu Mar 28, 2024 3:34 am

Re: Module Version Property

Post by PsCustomObject »

Thanks Brittney,

in case anybody else is facing this issue I can confirm workaround solved the issue, I've just put a comment on top of the manifest file and now properties tab in the GUI is working as intended.

What it's weird I did not modify the default manifest PsStudio is generating, if that makes any difference module was generated from functions.

I'll look forward a future release containing a bugfix for this.

Thanks again!

**Edit-1** I continue to mispell your name ;-)
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 1:00 pm
Answers: 39
Been upvoted: 30 times

Re: Module Version Property

Post by brittneyr »

This issue has been fixed and will be in the next service release (v5.6.168).
Brittney
SAPIEN Technologies, Inc.
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 1:00 pm
Answers: 39
Been upvoted: 30 times

Re: Module Version Property

Post by brittneyr »

Hello again, sorry for the wait.

Service build 5.6.168 has been released. Please let me know if this resolves your issue.
Brittney
SAPIEN Technologies, Inc.
This topic is 4 years and 5 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.