【发布时间】:2021-03-27 00:31:23
【问题描述】:
我使用的是 Powershell 7.0.3。 连接到 azure(通过 connect-AzAccount)后,我可以列出我的列主键:
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-SqlColumnMasterKey 和 New-SqlColumnEncryptionKey 应该在同一个模块中,通过
加载Import-Module "SqlServer"
我错过了什么?
【问题讨论】:
-
可能是版本控制问题——文档在记录什么版本包含什么方面非常糟糕(实际上,它取决于操作系统版本、PowerShell 版本和模块版本)。例如,在我的系统上,我有这个 cmdlet 和模块的版本 21.1.1879。导入后试试
Get-Module SqlServer。
标签: sql-server powershell azure-powershell always-encrypted