Page 1 of 1

Module Version Property

Posted: Fri Aug 09, 2019 6:20 am
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 1378 times
Despite module version is correctly declared in my module manifest:
ModuleManifest.png
ModuleManifest.png (13.59 KiB) Viewed 1378 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 1378 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.

Re: Module Version Property

Posted: Fri Aug 09, 2019 7:24 am
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?

Re: Module Version Property

Posted: Mon Aug 12, 2019 1:00 am
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!

Re: Module Version Property

Posted: Mon Aug 12, 2019 7:22 am
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.

Re: Module Version Property

Posted: Tue Aug 13, 2019 2:30 am
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 ;-)

Re: Module Version Property

Posted: Mon Sep 16, 2019 11:55 am
by brittneyr
This issue has been fixed and will be in the next service release (v5.6.168).