How do I use Add-Type to load Microsoft.Web.Deployment?

前端 未结 1 652
予麋鹿
予麋鹿 2020-12-18 20:19

I am writing some PowerShell scripts that use the MSDeploy API. I can load the assembly using

[System.Reflection.Assembly]::LoadWithPartialName(\"Microsoft.         


        
相关标签:
1条回答
  • 2020-12-18 21:15

    PowerShell only allows a certain pre-defined set of assemblies to be loaded by their partial/simple name. You're going to need to load it via its fully qualified name, for example:

    Add-Type -AssemblyName ('Microsoft.Web.Deployment, Version=7.1.0.0, ' +
                            'Culture=neutral, PublicKeyToken=31bf3856ad364e35')
    
    0 讨论(0)
提交回复
热议问题