Fix: "Import-Module : Could not load file or assembly"
This is an issue that affected pre-release versions of CloudPower. It has been resolved by including a Windows Installer package to automate the process of deploying files to the correct locations.
Description of Issue:
After installing CloudPower and trying to run commands or scripts, you may see an error similar to this one.
Import-Module : Could not load file or assembly
or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
At C:\Users\xxx\documents\WindowsPowerShell\Modules\Examples\Import Content Types\Provision-InfoArch.ps1:5 char:1
+ Import-Module CloudPower
+ CategoryInfo : NotSpecified: (:) [Import-Module], FileLoadException
+ FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand
This can occur because the DLLs have been installed to the WindowsPowerShell\Modules folder from a ZIP file and Windows has blocked them from execution.
This can also occur if your PowerShell EXE does not support the correct version of the .NET framework.
Unblock the ZIP file before you extract. Otherwise you will have to individually unblock each file separately.
Make sure that you have added the necessary .NET framework versions to the PowerShell configuration files. CloudPower is currently built on .NET framework 4.5. These configuration files are located at:
<supportedRuntime version="v2.0" />
<supportedRuntime version="v3.5" />
<supportedRuntime version="v4.0" />
<supportedRuntime version="v4.5" />
<supportedRuntime version="v4.6" />