Good Morning
I need some help. I am a student and learning powershell. I need some assitance or training with parameters.
I need to create a small script that will check if dnszone is created if it is not then create it
I have done this so far
$check = Get-AzDnsZone
if ($check -ne $null)
{
Write-Output “It does not exisit”
Remove-AzDnsZone -Name wayne.com -ResourceGroupName powershelltest
Write-Output “It was removed”
break
}
else
{
New-AzDnsZone -Name wayne.com -ResourceGroupName powershelltest
Write-Output “It was created”
break
}
However, i am sure there is a better way to do with parameters at the very basic level. please help
param([string]$check)