PowerShell is a scripting language that allows you to control and automate a whole lot of technology. It is really the premier administration tool for managing Office 365 and Azure. Unfortunately, because of its ‘programming’ nature many IT Professionals have avoided it.
One of the issues with PowerShell has been configuring the environment to allow access to everything you need. Typically, you needed to download and install separate modules to allow commands to be execute for Office 365 service and Azure. PowerShell 5 has overcome that problem by allowing you to download and install these modules directly from the PowerShell command line.
Thus, you need to firstly have PowerShell 5.0 on your machine. PowerShell 5 is included with the latest versions of Windows 10 but unfortunately it isn’t currently installed by default on Windows Server 2012 R2. This means if you want to use PowerShell version 5 on a server you’ll typically need to firstly download and install it.
For a Windows Server 2012 R2 you’ll need to download and install the Windows Management Framework 5,0 which you can find here:
When executed it will scan the machine to determine what updates need to be installed.
You’ll then be promoted to install any updates.
After these updates have been installed you may need to be reboot the machine.
To download and install the Azure module for PowerShell simply open a new PowerShell command prompt now and type:
You maybe be prompted to install the NuGet provider. Enter Y here to accept this.
You may also be prompted that you are installing from an untrusted repository. Again, select Y here to continue.
You should now see the module package being downloaded and installed as shown above.
When complete you’ll be returned to the command prompt.
To install the Azure Resource Manager module now type:
You should again see this module being downloaded and installed as shown above.
You’ll again be returned to the command prompt when complete.
Now if you issue the command:
You will see all the see all the PowerShell modules that are available to you. In the above example you can see both the Azure and AzureRM modules are listed as available.
If you now issue the command:
You will see the version of PowerShell installed (here version 5 as expected).
That’s a lot easier than it ever used to be with PowerShell and another reason why you should be using the latest version!