Powershell Flashcards

1
Q

What is the predictable naming scheme for AZ CLI commands?

A

az <service> <N> <service>
e.g.</service></N></service>

  • az vm list
  • az keyvault create
  • az network vnet delete
  • az network vnet subnet list
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the predictable naming scheme for PowerShell commands?

A

<Verb>-<function>

e.g.

* Get-AzVM
* New-AzVM
* Remove-AzVM
* Get-AzKeyVault
* New-AzKeyVault
* Remove-AzKeyVault
* Get-AzVirtualNetwork
* New-AzVirtualNetwork
* Remove-AzVirtualNetwork
</function></Verb>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe the different CLI options

A
  • Azure CLI
  • Powershell with AZ modules installed
  • Powershell core with AZ modules installed (cross platform powershell)
  • Bash with powershell packages installed
  • Azure cloud shell
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What’s the difference between Az and AzureRM?

A

Az replaced AzureRM. They cannot co-exist.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the PowerShell command to connect to Azure?

A

Connect-AzAccount

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the powershell command to check the installed versions of the Az module?

A

Get-InstalledModule -Name Az -AllVersions | Select-Object -Property Name, Version

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How to convert data to a a csv in PowerShell?

A

Get-AzWebApp | Select-Object Name, Location | ConvertTo-CSV -NoTypeInformation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to switch between different subscriptions in your AzConection

A

List all subscriptions

Get-AzSubscription
# Use a particular subscription based on its ID
Set-AzContext -Subscription “<subscription>"</subscription>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to install a webserver on a VM using Powershell?

A

From the cloudshell:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly