-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathSome_Tasks_in_Azure.ps1
31 lines (23 loc) · 1.18 KB
/
Some_Tasks_in_Azure.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
Set-Location c:\
Clear-Host
#Install the latest version of the PowerShellGet module
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-Module -Name PowerShellGet -Force -SkipPublisherCheck
#Install the latest version of the Az PowerShell module
Install-Module -Name Az -Force -AllowClobber -Verbose
#Log into Azure
Connect-AzAccount
#Select the correct subscription
Get-AzSubscription -SubscriptionName "MSDN Platforms" | Select-AzSubscription
Get-AzContext
#Check DNS availability
$location = 'westeurope'
Test-AzDnsAvailability -Location $location -DomainNameLabel aaddsadatum
#Register the Microsoft.Compute resource provider
Register-AzResourceProvider -ProviderNamespace 'Microsoft.Compute'
#Verify the registration status
Get-AzResourceProvider -ListAvailable | Where-Object {$_.ProviderNamespace -eq 'Microsoft.Compute'}
#Identify the current usage of vCPUs and the corresponding limits for the StandardDSv3Family and StandardBSFamily
$location = 'westeurope'
Get-AzVMUsage -Location $location | Where-Object {$_.Name.Value -eq 'StandardDSv3Family'}
Get-AzVMUsage -Location $location | Where-Object {$_.Name.Value -eq 'StandardBSFamily'}