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 SUBSCRIPTION NUMBERS, LICENSE 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.
User avatar
PsCustomObject
Posts: 80
Joined: Tue Apr 29, 2014 1:55 am

Module Version Property

Post by PsCustomObject » Fri Aug 09, 2019 6:20 am

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 2304 times
Despite module version is correctly declared in my module manifest:
ModuleManifest.png
ModuleManifest.png (13.59 KiB) Viewed 2304 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 2304 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: 234
Joined: Thu Jun 01, 2017 7:20 am

Re: Module Version Property

Post by brittneyr » Fri Aug 09, 2019 7:24 am

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 Ryn
SAPIEN Technologies, Inc.

User avatar
PsCustomObject
Posts: 80
Joined: Tue Apr 29, 2014 1:55 am

Re: Module Version Property

Post by PsCustomObject » Mon Aug 12, 2019 1:00 am

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: 234
Joined: Thu Jun 01, 2017 7:20 am

Re: Module Version Property

Post by brittneyr » Mon Aug 12, 2019 7:22 am

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 Ryn
SAPIEN Technologies, Inc.

User avatar
PsCustomObject
Posts: 80
Joined: Tue Apr 29, 2014 1:55 am

Re: Module Version Property

Post by PsCustomObject » Tue Aug 13, 2019 2:30 am

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: 234
Joined: Thu Jun 01, 2017 7:20 am

Re: Module Version Property

Post by brittneyr » Mon Sep 16, 2019 11:55 am

This issue has been fixed and will be in the next service release (v5.6.168).
Brittney Ryn
SAPIEN Technologies, Inc.

User avatar
brittneyr
Site Admin
Posts: 234
Joined: Thu Jun 01, 2017 7:20 am

Re: Module Version Property

Post by brittneyr » Mon Oct 21, 2019 8:23 am

Hello again, sorry for the wait.

Service build 5.6.168 has been released. Please let me know if this resolves your issue.
Brittney Ryn
SAPIEN Technologies, Inc.