Azure DNSZonePowershell

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 -ResourceGroupName powershelltest
Write-Output “It was removed”
New-AzDnsZone -Name -ResourceGroupName powershelltest
Write-Output “It was created”

However, i am sure there is a better way to do with parameters at the very basic level. please help

Well your first line would not work since you did not specify a resource group (required). Your code is pretty static, if you want to make it more useful you’ll want to learn how to write a function.