Powershell
- Cmdlets:
- smallest unit of action in Powershell
- Cmdlets will be in the form of
<verb>-<noun>
- Examples
New-Item Get-Command Get-Help
- Get-Command Cmdlet helps in finding the cmdlets available on the system
- Get-Help Cmdlet is used to find the help
- Pipe: Like linux/unix pipe is used to send the output of one command to other, but unlike linux/unix in the powershell the objects are transferred
Azure Powershell
-
Refer Here for Azure Powershell Installation
-
Lets Get Started with Creating a resource Group
Get-Command '*-AzResourceGroup'
Get-Help 'New-AzVirtualNetwork' -Online
- I’m sharing a simple PS to create and delete Resource group, please add the virtual network with 4 subnets and a network security group
# Create a resource group
$rg = New-AzResourceGroup -Name 'fromps' -Location 'centralus'
# Create a virtual Network
$vnet = New-AzVirtualNetwork -Name 'vnetfromps' -ResourceGroupName $rg.ResourceGroupName -Location $rg.Location -AddressPrefix '10.10.0.0/16'
# Remove Resource Group
Remove-AzResourceGroup -Name $rg.ResourceGroupName -Force