-
Notifications
You must be signed in to change notification settings - Fork 6
/
Microsoft.PowerShell_azure-profile.ps1
88 lines (85 loc) · 2.65 KB
/
Microsoft.PowerShell_azure-profile.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
## disable AZ CLI cert validation to prevent
## failures that occur behind some corporate firewalls
##
$Env:AZURE_CLI_DISABLE_CONNECTION_VERIFICATION = "1"
$Env:ADA_PYTHON_SSL_NO_VERIFY = "1"
Function Get-AzCurrentSubscription {
$context = Get-AzContext
$name = $context.Name
$matched = $name -match "^.*\((?<guid>[^\)]+)\).*$"
if ($matched) {
return $matches["guid"]
}
}
Set-Alias -Name Get-CurrentAzSubscription -Value Get-AzCurrentSubscription
Set-Alias -Name azaccount -Value Get-AzCurrentSubscription
#Begin Azure PowerShell alias import
Import-Module Az.Accounts -ErrorAction SilentlyContinue -ErrorVariable importError
if ($importerror.Count -eq 0) {
Write-Host "Enable-AzureRmAlias" -ForegroundColor DarkGray
Enable-AzureRmAlias -Module `
Az.Accounts, `
Az.Aks, `
Az.AnalysisServices, `
Az.ApiManagement, `
Az.ApplicationInsights, `
Az.Automation, `
Az.Backup, `
Az.Batch, `
Az.Billing, `
Az.Cdn, `
Az.CognitiveServices, `
Az.Compute, `
Az.Compute.ManagedService, `
Az.ContainerInstance, `
Az.ContainerRegistry, `
Az.DataFactory, `
Az.DataLakeAnalytics, `
Az.DataLakeStore, `
Az.DataMigration, `
Az.DeviceProvisioningServices, `
Az.DevSpaces, `
Az.Dns, `
Az.EventGrid, `
Az.EventHub, `
Az.FrontDoor, `
Az.HDInsight, `
Az.IotCentral, `
Az.IotHub, `
Az.KeyVault, `
Az.LogicApp, `
Az.MachineLearning, `
Az.ManagedServiceIdentity, `
Az.ManagementPartner, `
Az.Maps, `
Az.MarketplaceOrdering, `
Az.Media, `
Az.Monitor, `
Az.Network, `
Az.NotificationHubs, `
Az.OperationalInsights, `
Az.PolicyInsights, `
Az.PowerBIEmbedded, `
Az.RecoveryServices, `
Az.RedisCache, `
Az.Relay, `
Az.Reservations, `
Az.ResourceGraph, `
Az.Resources, `
Az.Scheduler, `
Az.Search, `
Az.Security, `
Az.ServiceBus, `
Az.ServiceFabric, `
Az.SignalR, `
Az.Sql, `
Az.Storage, `
Az.StorageSync, `
Az.StreamAnalytics, `
Az.Subscription, `
Az.TrafficManager, `
Az.Websites `
-ErrorAction SilentlyContinue `
;
}
#End Azure PowerShell alias import