我在跑
Export-DbaInstance -SqlInstance $sourceServerName -Path $absPathToBackupScriptDir
并得到错误'无法加载文件或程序集'Microsoft.SqlServer.ConnectionInfo'
我尝试为 Visual Studio 2013 和 2017 安装 Microsoft Visual C++ Redistributable
我尝试使用下面的 CMD 将有问题的 DLL(包含在 DbaTools 模块中)添加到 GAC
gacutil.exe /i "C:\Program Files\WindowsPowerShell\Modules\dbatools\bin\smo\Microsoft.SqlServer.ConnectionInfo.dll"
我尝试使用下面的 Powershell 安装最新版本的 DbaTools(撰写本文时约为 0.9.x)
Invoke-Expression (Invoke-WebRequest -UseBasicParsing https://dbatools.io/in)
输入的命令和完整的输出错误信息都在下面
Export-DbaInstance -SqlInstance $sourceServerName -Path $absPathToBackupScriptDir
'Could not load file or assembly 'Microsoft.SqlServer.ConnectionInfo' Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91 or one of its dependencies. The system cannot find the file specified.'