Powershell Flashcards
What is the predictable naming scheme for AZ CLI commands?
az <service> <N> <service>
e.g.</service></N></service>
- az vm list
- az keyvault create
- az network vnet delete
- az network vnet subnet list
What is the predictable naming scheme for PowerShell commands?
<Verb>-<function>
e.g.
* Get-AzVM
* New-AzVM
* Remove-AzVM
* Get-AzKeyVault
* New-AzKeyVault
* Remove-AzKeyVault
* Get-AzVirtualNetwork
* New-AzVirtualNetwork
* Remove-AzVirtualNetwork
</function></Verb>
Describe the different CLI options
- Azure CLI
- Powershell with AZ modules installed
- Powershell core with AZ modules installed (cross platform powershell)
- Bash with powershell packages installed
- Azure cloud shell
What’s the difference between Az and AzureRM?
Az replaced AzureRM. They cannot co-exist.
What is the PowerShell command to connect to Azure?
Connect-AzAccount
What is the powershell command to check the installed versions of the Az module?
Get-InstalledModule -Name Az -AllVersions | Select-Object -Property Name, Version
How to convert data to a a csv in PowerShell?
Get-AzWebApp | Select-Object Name, Location | ConvertTo-CSV -NoTypeInformation
How to switch between different subscriptions in your AzConection
List all subscriptions
Get-AzSubscription
# Use a particular subscription based on its ID
Set-AzContext -Subscription “<subscription>"</subscription>
How to install a webserver on a VM using Powershell?
From the cloudshell: