Sql server Powershell-术语';新的SqlColumnEncryptionKey';无法识别-正在尝试创建列加密密钥

Sql server Powershell-术语';新的SqlColumnEncryptionKey';无法识别-正在尝试创建列加密密钥,sql-server,powershell,azure-powershell,always-encrypted,Sql Server,Powershell,Azure Powershell,Always Encrypted,我正在使用Powershell 7.0.3。 连接到azure(通过connect AzaAccount)后,我可以列出我的列主密钥: Get-SqlColumnMasterKey -InputObject $database Name ---- MYDB_CMK MYDB_CMK2 在尝试创建列加密密钥时 New-SqlColumnEncryptionKey -Name "MYDB_CEK" -InputObject $database -ColumnMasterKey

我正在使用Powershell 7.0.3。 连接到azure(通过connect AzaAccount)后,我可以列出我的列主密钥:

Get-SqlColumnMasterKey -InputObject $database

Name
----
MYDB_CMK
MYDB_CMK2
在尝试创建列加密密钥时

New-SqlColumnEncryptionKey -Name "MYDB_CEK" -InputObject $database -ColumnMasterKey "MYDB_CMK"
我得到以下错误:

New-SqlColumnEncryptionKey: The term 'New-SqlColumnEncryptionKey' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
据我所知,命令Get SqlColumnMasterKeyNew SqlColumnEncryptionKey应该在同一个模块中,通过

Import-Module "SqlServer" 

我错过了什么?

是的,它是SqlServer模块的一部分,但仅在Powershell 5中受支持:


这可能是一个版本控制问题——文档在记录什么版本包括什么方面非常糟糕(实际上,这取决于操作系统版本、PowerShell版本和模块版本)。例如,在我的系统上,我有这个cmdlet和21.1.1879版的模块。导入后,请尝试获取模块SqlServer。谢谢singhh msft。当我转到Powershell 7时,这有点令人迷惑,因为有些东西在5中不起作用,现在我的7个脚本在5中也不起作用。嘿,是什么让它如此。。。激动人心的:D干杯。