Skip to main content

Get module version from .psd1

Submitted by admin on Fri, 01/20/2017 - 20:59

In order to get the module version from a .psd1 file, without using regex or string parsing, you can do the following:

(Test-ModuleManifest TestModule.psd1).Version.ToString()

As an example, I used this to insert the module version into log files, which where created by the module itself.

Tags