Add-Type load assembly from network UNC share error 0x80131515

前端 未结 3 825
后悔当初
后悔当初 2020-12-06 19:17

When you want to add an assembly from a network UNC share using the command:

$scriptPath = Split-Path ($MyInvocation.MyCommand.Path)
Add-Type -path \"$script         


        
3条回答
  •  一个人的身影
    2020-12-06 20:05

    Instead of Add-Type you could:

    [System.Reflection.Assembly]::UnsafeLoadFrom('\\uncpath\driver.dll')
    

    It'll ignore some security settings and load the library but it's, well, unsafe ;).

提交回复
热议问题