Azure powershell startup

Every time I open windows with blue backlight in azure mode, is it possible to auto-register?

i.e. this command below should be run every time I open the Azure team window.

Get-AzurePublishSettingsFile (path on local computer)

or even Add-AzureAccount

+4
source share
5 answers

Can you do this. Follow these steps:

Azure PowerShell "C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Services\ShortcutStartup.ps1" 64- "C:\Program Files\Microsoft SDK\Azure\PowerShell\ServiceManagement\Azure\Services\ShortcutStartup.ps1" 32- .

$VerbosePreference="Continue"

$username = "<username>"
$password = "<password>"
$secpasswd = ConvertTo-SecureString $password -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ($userName, $secpasswd)
Add-AzureAccount -Credential $cred

@Update: Azure ARM Login-AzureRMAccount -Credential $cred. Microsoft.

+7

Import-AzurePublishSettingsFile, ( :% userprofile%\AppData\Roaming\Windows Azure Powershell\WindowsAzureProfile.xml). , . , . -SubscriptionDataFile, , .

, , , PowerShell, / , .

, , , . , , - , , . SubscriptionDataFile, . Set-AzureSubscription , , - .

Add-AzureAccount, , ; Azure AD. , , . Add-AzureAccount , PowerShell, , .

, , , remove-azuresubscription . PowerShell 3, Azure Module , .

+3

, Azure Powershell - .

- , . Azure, , , , , .

, .

+3

Powershell (C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1)

Import-Module azure;
Get-AzurePublishSettingsFile YourPath
Add-AzureAccount YourAccount

.

+1

, , 4.4.0, :

Enable-AzureRmContextAutosave

.

0

Source: https://habr.com/ru/post/1537868/


All Articles