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

前端 未结 3 820
后悔当初
后悔当初 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:08

    Re: ALIENQuake's. I've added your fix to a PS script to install the files in the correct locations.

    $PSPaths = 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe.config','C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe.config'
    $XMLCode = @"
     
    
       
             
        
    
    "@
    foreach($PSConfigFile in $PSPaths) {
        $xmlcode | Out-File -FilePath $PSConfigFile -Encoding utf8 
    }
    

提交回复
热议问题