I'm trying to add an assembly into Powershell but I keep getting:
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly "path etc" or one of its dependencies. Access is denied."
Does anyone know why I'm getting "Access Denied", I'm also running Powershell as admin and checked the .dll properties.
# Load the assembly. I used a relative path so I could off using the Resolve-Path cmdlet $ScriptDirectory = (gi $PSCommandPath).DirectoryName Join-Path $ScriptDirectory "taglib-sharp.dll" [Reflection.Assembly]::LoadFrom( (Resolve-Path "$ScriptDirectory"))
Have you tried the below approach below instead?
Add-Type -Path $Taglib-SharpDll $TagSharp = New-Object TagSharptype
You call a static method like so:
Instead of Add-Type, you can also use reflection:
This approach is also calling the Reflection library and the LoadFile static method.
You must be logged in to reply to this topic.