0

我现在收到以下错误:

PS C:\WINDOWS\system32> Test-DBADbCompatibility -SqlInstance localhost -Database EfficaDB

Cannot convert value "Version150" to type 
"Microsoft.SqlServer.Management.Smo.CompatibilityLevel". Error: "Unable to match the 
 identifier name Version150 to a valid enumerator name. 
Specify one of the following enumerator names and try again:Version60, Version65, 
Version70, Version80, Version90, Version100, Version110, Version120, Version130, Version140"
At C:\Program Files\WindowsPowerShell\Modules\dbatools\1.1.40\allcommands.ps1:77485 char:93
+ ... r.Management.Smo.CompatibilityLevel]"Version$($server.VersionMajor)0"+
~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : SubstringDisambiguationEnumParseThrewAnException

我已将最新版本的 DBATools 安装到服务器中。

4

1 回答 1

0

我在 PowerShell 脚本文件的开头添加了以下语句,从而解决了错误:

import-module DBATools
import-module sqlserver
于 2021-12-08T17:11:53.533 回答