Error occurs just in normal prompt, not ISE

2

I was confronted with the following error:

Add-Type : Die Datei oder Assembly "file://\\myuncpath\my.dll" oder eine Abhängigkeit 
davon wurde nicht gefunden. Der Vorgang wird nicht unterstützt. (Ausnahme von HRESULT: 0x80131515)
In Zeile:1 Zeichen:1
+ Add-Type -Path "\\myuncpath\my.dll"     
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Add-Type], FileLoadException
        + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.AddTypeCommand

Sorry for it being German but I guess sole the stack trace will help out as well.

And fixed it by enabling loadFromRemoteSources. However this just fixes it for the Powershell ISE not for the typical command prompt that starts when I use right click -> "execute Powershell script".

Does the config not apply to the normal prompt?

Error in English:

Add-Type : Could not load file or assembly 'file://\\myuncpath\my.dl'
or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
At line:1 char:1 + Add-Type -Path "\\myuncpath\my.dll"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Add-Type], FileLoadException
    + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.Ad‌​dTypeCommand
powershell
assemblies
dllimport
asked on Stack Overflow Apr 13, 2017 by oRookie • edited May 23, 2017 by Community

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0