我正在尝试编写使用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
模块)上执行相同的脚本,并且遇到相同的错误。
我在某个地方错过了一步吗?