UIAutomation and PowerShell 4.0

Feb 12, 2016 at 2:59 PM

Is there a known issue with running UIAutomation module on PowerShell 4.0?

When trying to load the module, an error occurs:

import-module : Could not load file or assembly 'file:///C:\Users...\Documents\WindowsPowerShell\Modules\uiautoma
tion\uiautomation.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
At line:1 char:1
  • import-module
  • ~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [Import-Module], FileLoadException
    • FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand
I am running windows 8, powershell 4.0, uiautomation 0.8.7B3.NET40

If I use 0.8.7B3.NET35 instead and start PowerShell from cmd with -version 2.0, it works ok (same machine).
Feb 16, 2016 at 7:53 PM
Hi JohnQuest, could it be that file UIAutomation.dll from the NET40 pack is blocked, i.e. you can see the Unblock button in properties of a file?
Sorry, I didn't notice your post earlier.
Feb 17, 2016 at 9:38 AM
Yes, you are right. Sorry about that.