2016-02-04 4 views
2

Я скачал и установил Azure Powershell, следуя инструкциям MS: https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/Azure PowerShell не соединится

Использование Windows PowerShell ISE я выполнить команду:

Логин-AzureRmAccount

, который возвращает ошибку:

Login-AzureRmAccount : The 'Login-AzureRmAccount' command was found in the module 'AzureRM.Profile', but the module could not be loaded. For more information, run 'Import-Module AzureRM.Profile'. At line:1 char:1 
+ Login-AzureRmAccount 
+ ~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : ObjectNotFound: (Login-AzureRmAccount:String) [], CommandNotFoundException 
    + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule 

Import-Module AzureRM.Profile

возвращает эту ошибку:

Import-Module : File C:\Program Files (x86)\Microsoft 
SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.Profile\CheckVersions.ps1 cannot be loaded 
because running scripts is disabled on this system. For more information, see about_Execution_Policies at 
http://go.microsoft.com/fwlink/?LinkID=135170. 
At line:1 char:1 
+ Import-Module AzureRM.Profile 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : SecurityError: (:) [Import-Module], PSSecurityException 
    + FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand 

Почему это так трудно подключиться к Azure, что может быть не так?

+1

что текущий 'executionpolicy' в вашей системе? – Kiran

+1

Возможный дубликат [PowerShell говорит, что выполнение сценариев в этой системе отключено. »] (Http://stackoverflow.com/questions/4037939/powershell-says-execution-of-scripts-is-disabled-on-this- system) – Matt

+0

В вашей системе отключены сценарии запуска. Для получения дополнительной информации см. About_Execution_Policies по адресу http://go.microsoft.com/fwlink/?LinkID=135170 –

ответ

13

Из командной строки запуска:

powershell Set-ExecutionPolicy RemoteSigned 
+1

Это правильный ответ –

Смежные вопросы