-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path11 az.resources az-powershell-basics.ps1
36 lines (26 loc) · 1.1 KB
/
11 az.resources az-powershell-basics.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
# Az.Resources
#
Exit #Prevent F5
# See commands, their nouns and verbs to get a high level sense of what we can do with this module
Get-Command -Module Az.Resources # | Out-GridView # For windows users
# See verbs
Get-Command -Module Az.Resources | Group-Object -Property Verb
# See nouns
Get-Command -Module Az.Resources | Group-Object -Property Noun
Get-AzResource
Get-AzResourceGroup
# Create a resource group
#Instead of defining this here, I'll define it in _settings.ps1 and 'dot source' it
#This is like an include file, so I can use it in other scripts
#$myResourceGroupName = 'dpsug-demo'
# Put your settings into this _my-settings.ps1 file to use these scripts
. ./_my-settings.ps1
$myResourceGroupName
Get-Help New-AzResourceGroup -Examples
#Add the -Debug switch to see the underlying details including the API call
New-AzResourceGroup -ResourceGroupName $myResourceGroupName -Location $myLocation -Debug
Show-Command New-AzResourceGroup
# Can I set this as default resource group?
Get-Help Set-AzDefault -ShowWindow
Set-AzDefault -ResourceGroupName $myResourceGroupName
Get-AzDefault | Select-Object *