我现在收到以下错误:
PS C:WINDOWSsystem32> 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 FilesWindowsPowerShellModulesdbatools1.1.40allcommands.ps1:77485 char:93
+ ... r.Management.Smo.CompatibilityLevel]"Version$($server.VersionMajor)0"+
~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : SubstringDisambiguationEnumParseThrewAnException
我已经在服务器中安装了最新版本的DBATools。
我在PowerShell脚本文件的开头添加了以下语句,解决了错误:
import-module DBATools
import-module sqlserver