Experts,

What would cause the following when running the this command :

Add-Type -Path 'C:\Test-CitrixRebootScript\UtilityFunctions\itext2\itextsharp.dll'


2\itextsharp.dll'
or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
At line:1 char:1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I have attempted the following already :

LVL 17
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Which OS? Can't reproduce on W2k12R2, W2k16, Win10.
It could be that the dll requires .NET 2.0 (can't find a list of requirements), which is not installed by default.
Author Commented:
Not sure why, but I had to set-location to my itext directory before It would work. I couldn't call it by full path.

Importing using this :
*Worked*
Add-Type -Path '.\itextsharp.dll'


*Didn't work**
Add-Type -Path 'C:\Test-CitrixRebootScript\UtilityFunctions\itext2\itextsharp.dll'

Commented:
Can't reproduce that, either. Can load from pretty much any folder, including the HKLM drive.
Did you first try it from a file system drive or from another provider?
Can you use the full path when you're in the dll's folder?
Are there other dlls in the folder where you were during your first attempt?
Author Commented:
oBdA no, there are only two files in that folder, the XML and the DLL associated with iText.

PS C:\Test-CitrixRebootScript\UtilityFunctions\itext2>
Unblock-File -Path .\itextsharp.dll


PS C:\Test-CitrixRebootScript\UtilityFunctions\itext2>
Add-Type -Path 'C:\Test-CitrixRebootScript\UtilityFunctions\itext
2\itextsharp.dll'

or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
At line:1 char:1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Author Commented:
I agree with you however, that should not have been an issue if it worked while local to the folder... Strange..
Author Commented:
Found my own solution, but now I have more questions than answers. As it shouldn't have been a problem to begin with..

Not sure why, but I had to set-location to my itext directory before It would work. I couldn't call it by full path.

Importing using this :
*Worked*
Add-Type -Path '.\itextsharp.dll'


*Didn't work**
Add-Type -Path 'C:\Test-CitrixRebootScript\UtilityFunctions\itext2\itextsharp.dll'


Experts Exchange Solution brought to you by