【发布时间】:2020-03-07 07:44:27
【问题描述】:
我正在尝试编写一个使用 Switch-AzSqlDatabaseFailoverGroup cmdlet 的 Powershell 脚本。该脚本将在自动化运行手册中执行,并且我已成功将Az.Sql 模块安装到自动化帐户中。但是,每当我运行这本书时,都会出现以下错误:
Switch-AzSqlDatabaseFailoverGroup : The 'Switch-AzSqlDatabaseFailoverGroup' command was found in the module 'Az.Sql', but the module could not be loaded. For more information, run 'Import-Module Az.Sql'.
At line:42 char:5
+ Switch-AzSqlDatabaseFailoverGroup `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Switch-AzSqlDatabaseFailoverGroup:String) [], CommandNotFoundException + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
我尝试在本地机器上执行相同的脚本(安装了Az.Sql 模块)并得到同样的错误。
我是不是在某个地方漏掉了一步?
【问题讨论】:
标签: powershell azure-sql-database azure-automation