【发布时间】:2019-05-09 12:39:32
【问题描述】:
在 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>]
【问题讨论】:
-
你在管道参数吗?
标签: azure powershell azure-runbook