Errors running Azure PowerShell cmdlets in MIMWAL workflow


Just a quick one as this has been discussed on the net before but if you are trying to run Azure PowerShell cmdlets in a MIMWAL workflow or embedded in a custom work flow and get the below error:

Import-Module : Could not load file or assembly ‘file:///C:\Windows\system32\WindowsPowerShell\v1.0\Modules\MSOnline\Microsoft.Online.Administration.Automation.PSModule.dll’ or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

This is because the MIMWAL is built on the .net framework 3.5 whereas the later Azure PowerShell cmdlets are built on .net 4, if you can live with the older functionality the easy fix is to install version 1 of the cmdlets 64 bit from here or here for the 32 bit versions these are build 8362.1 so getting a bit old but have most of the required functionality. The whole list of versions is here but anything later than 8362.1 will not work. The other option is to take your script out of the workflow and trigger it externally.

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Appliance - Powered by TurnKey Linux