← All Articles

Get Module Version From .psd1

Jan. 20, 2017

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.

← All Articles