在 Azure 中,我想使用 PowerShell 自动化运行手册使用以下命令重命名 SQL 数据库:
Set-AzureRmSqlDatabase -ResourceGroupName <ResourceGroupName>
-ServerName <ServerName> -DatabaseName <DatabaseName> -NewName <NewName>
此命令在 Azure 门户顶部导航的 Launch Cloud Shell 中运行良好。
但在运行手册中,它不适用于此错误:
Set-AzureRmSqlDatabase :找不到与参数名称“NewName”匹配的参数。
运行手册中似乎-NewName
缺少
Set-AzureRmSqlDatabase `
-DatabaseName <System.String> `
-ResourceGroupName <System.String> `
[-ElasticPoolName <System.String>] `
[-Tags <System.Collections.Generic.Dictionary`2[System.String,System.String]>] `
[-RequestedServiceObjectiveName <System.String>] `
-ServerName <System.String> `
[-Edition <Microsoft.Azure.Commands.Sql.Database.Model.DatabaseEdition>] `
[-MaxSizeBytes <System.Int64>]