Tuesday, February 10, 2015

PowerShell Suggestions : Write the Azure PowerShell Module version in all of your Azure Scripts.

 

She emailed me, Yes! "A Murky Ana!" and in the email she asked me that if it is necessary to document a "PowerShell Module version" in the "PowerShell scripts"?

I replied to her :-

Hi Ana!,

It's really good to document "PowerShell Module" version information of you are about to use a single PowerShell module only. For example, if you about to write a Long PowerShell scripts only for Microsoft Azure, then it's worth to mention a module version on the top of your PowerShell Scripts.

it's help other to check their Azure PowerShell module version before running your scripts so that no compatibility issues arises. If you like you can write a little bit tiny-miny PowerShell function to check the module version and only run the scripts if they match the desired version of the PowerShell modules.

09-02-2015 22-32-39

Checking the version of any module is very simple, just see the below command for an example.

PS C:\> (Get-Module -Name 'Azure').Version

Get-Module

I am hoping that you are able to understand now that it's a good to write the information of Module versions in the scripts.

* All characters appearing in this work are fictitious Any resemblance to real persons, living or dead, is purely coincidental.

 

Regards.

Aman Dhally
If you like, you can follow me on Twitter and Facebook. You can also check my “You Tube channel for PowerShell video tutorials. You can download all of my scripts from “Microsoft TechNet Gallery”.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.