I was trying to run a simple DSC where I create an app pool so I downloaded the xWebAdministration module, dumped it into C:\Program Files\WindowsPowerShell\Modules directory, set up my configuration, ran it and got this error:
Importing module MSFT_xWebAppPool failed with error – File C:\Program Files\WindowsPowerShell\Modules\xWebAdministration\DscResources\MSFT_xWebAppPool\MSFT_xWebAppPool.psm1 cannot be loaded because you opted not to run this software now.
Whaaaaaat? Turns out, when I downloaded the module and unzipped it, it left the psm1 file to be in a blocked state. I browsed to the psm1 file and right clicked it.
This brought up the Properties dialog. Click the Unblock button, then Apply button and then the OK button.
Voila. Problem fixed.
thank you this worked for me. first I thought it was because one server was running powershell 4 and the other was running v5.