在使用add-type添加類的時候咱們沒法判斷具體的錯誤緣由ide
可以使用如下方法:3d
try {Add-Type -Path "C:\lync2013\Microsoft.Lync.Model.dll"} blog
catch [Reflection.ReflectionTypeLoadException]{$_.Exception.LoaderExceptions}get
可清晰看到錯誤的緣由it