|
| 1 | +<# |
| 2 | +.Synopsis |
| 3 | +Creates or updates a record set within a DNS zone. |
| 4 | +.Description |
| 5 | +Creates or updates a record set within a DNS zone. |
| 6 | +.Example |
| 7 | +To view examples, please use the -Online parameter with Get-Help or navigate to: https://docs.microsoft.com/en-us/powershell/module/az.dns/new-azdnsrecordset |
| 8 | +.Outputs |
| 9 | +Microsoft.Azure.PowerShell.Cmdlets.Dns.Models.Api20180501.IRecordSet |
| 10 | +.Link |
| 11 | +https://docs.microsoft.com/en-us/powershell/module/az.dns/new-azdnsrecordset |
| 12 | +#> |
| 13 | +function New-AzDnsRecordSet_CreateA { |
| 14 | +[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Dns.Models.Api20180501.IRecordSet')] |
| 15 | +[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] |
| 16 | +[Microsoft.Azure.PowerShell.Cmdlets.Dns.Profile('latest-2019-04-30')] |
| 17 | +[Microsoft.Azure.PowerShell.Cmdlets.Dns.Description('Creates or updates a record set within a DNS zone.')] |
| 18 | +param( |
| 19 | + [Parameter(Mandatory, HelpMessage='The name of the record set, relative to the name of the zone.')] |
| 20 | + [Alias('RelativeRecordSetName')] |
| 21 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Path')] |
| 22 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Runtime.Info(SerializedName='relativeRecordSetName', Required, PossibleTypes=([System.String]), Description='The name of the record set, relative to the name of the zone.')] |
| 23 | + [System.String] |
| 24 | + # The name of the record set, relative to the name of the zone. |
| 25 | + ${Name}, |
| 26 | + |
| 27 | + [Parameter(Mandatory, HelpMessage='The name of the resource group.')] |
| 28 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Path')] |
| 29 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Runtime.Info(SerializedName='resourceGroupName', Required, PossibleTypes=([System.String]), Description='The name of the resource group.')] |
| 30 | + [System.String] |
| 31 | + # The name of the resource group. |
| 32 | + ${ResourceGroupName}, |
| 33 | + |
| 34 | + [Parameter(Mandatory, HelpMessage='Specifies the Azure subscription ID, which uniquely identifies the Microsoft Azure subscription.')] |
| 35 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Path')] |
| 36 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Runtime.Info(SerializedName='subscriptionId', Required, PossibleTypes=([System.String]), Description='Specifies the Azure subscription ID, which uniquely identifies the Microsoft Azure subscription.')] |
| 37 | + [System.String] |
| 38 | + # Specifies the Azure subscription ID, which uniquely identifies the Microsoft Azure subscription. |
| 39 | + ${SubscriptionId}, |
| 40 | + |
| 41 | + [Parameter(Mandatory, HelpMessage='The name of the DNS zone (without a terminating dot).')] |
| 42 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Path')] |
| 43 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Runtime.Info(SerializedName='zoneName', Required, PossibleTypes=([System.String]), Description='The name of the DNS zone (without a terminating dot).')] |
| 44 | + [System.String] |
| 45 | + # The name of the DNS zone (without a terminating dot). |
| 46 | + ${ZoneName}, |
| 47 | + |
| 48 | + [Parameter(Mandatory, HelpMessage='The list of A records in the record set. To construct, see NOTES section for ARECORD properties and create a hash table.')] |
| 49 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Body')] |
| 50 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Runtime.Info(SerializedName='ARecords', PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Dns.Models.Api20150504Preview.IARecord]), Description='The list of A records in the record set.')] |
| 51 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Models.Api20150504Preview.IARecord[]] |
| 52 | + # The list of A records in the record set. |
| 53 | + # To construct, see NOTES section for ARECORD properties and create a hash table. |
| 54 | + ${ARecord}, |
| 55 | + |
| 56 | + [Parameter(HelpMessage='Does not overwrite the record set if it already exists.')] |
| 57 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Header')] |
| 58 | + [System.Management.Automation.SwitchParameter] |
| 59 | + # Does not overwrite the record set if it already exists. |
| 60 | + ${DoNotOverwrite}, |
| 61 | + |
| 62 | + [Parameter(HelpMessage='The etag of the record set.')] |
| 63 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Body')] |
| 64 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Runtime.Info(SerializedName='etag', PossibleTypes=([System.String]), Description='The etag of the record set.')] |
| 65 | + [System.String] |
| 66 | + # The etag of the record set. |
| 67 | + ${Etag}, |
| 68 | + |
| 69 | + [Parameter(HelpMessage='The metadata attached to the record set.')] |
| 70 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Body')] |
| 71 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Runtime.Info(SerializedName='metadata', PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Dns.Models.Api20160401.IRecordSetPropertiesMetadata]), Description='The metadata attached to the record set.')] |
| 72 | + [System.Collections.Hashtable] |
| 73 | + # The metadata attached to the record set. |
| 74 | + ${Metadata}, |
| 75 | + |
| 76 | + [Parameter(HelpMessage='Resource Id.')] |
| 77 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Body')] |
| 78 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Runtime.Info(SerializedName='id', PossibleTypes=([System.String]), Description='Resource Id.')] |
| 79 | + [System.String] |
| 80 | + # Resource Id. |
| 81 | + ${TargetResourceId}, |
| 82 | + |
| 83 | + [Parameter(HelpMessage='The TTL (time-to-live) of the records in the record set.')] |
| 84 | + [Alias('Ttl')] |
| 85 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Body')] |
| 86 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Runtime.Info(SerializedName='TTL', PossibleTypes=([System.Int64]), Description='The TTL (time-to-live) of the records in the record set.')] |
| 87 | + [System.Int64] |
| 88 | + # The TTL (time-to-live) of the records in the record set. |
| 89 | + ${TimeToLive}, |
| 90 | + |
| 91 | + [Parameter(HelpMessage='The credentials, account, tenant, and subscription used for communication with Azure.')] |
| 92 | + [Alias('AzureRMContext', 'AzureCredential')] |
| 93 | + [ValidateNotNull()] |
| 94 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Azure')] |
| 95 | + [System.Management.Automation.PSObject] |
| 96 | + # The credentials, account, tenant, and subscription used for communication with Azure. |
| 97 | + ${DefaultProfile}, |
| 98 | + |
| 99 | + [Parameter(DontShow, HelpMessage='Wait for .NET debugger to attach')] |
| 100 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Runtime')] |
| 101 | + [System.Management.Automation.SwitchParameter] |
| 102 | + # Wait for .NET debugger to attach |
| 103 | + ${Break}, |
| 104 | + |
| 105 | + [Parameter(DontShow, HelpMessage='SendAsync Pipeline Steps to be appended to the front of the pipeline')] |
| 106 | + [ValidateNotNull()] |
| 107 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Runtime')] |
| 108 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Runtime.SendAsyncStep[]] |
| 109 | + # SendAsync Pipeline Steps to be appended to the front of the pipeline |
| 110 | + ${HttpPipelineAppend}, |
| 111 | + |
| 112 | + [Parameter(DontShow, HelpMessage='SendAsync Pipeline Steps to be prepended to the front of the pipeline')] |
| 113 | + [ValidateNotNull()] |
| 114 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Runtime')] |
| 115 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Runtime.SendAsyncStep[]] |
| 116 | + # SendAsync Pipeline Steps to be prepended to the front of the pipeline |
| 117 | + ${HttpPipelinePrepend}, |
| 118 | + |
| 119 | + [Parameter(DontShow, HelpMessage='The URI for the proxy server to use')] |
| 120 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Runtime')] |
| 121 | + [System.Uri] |
| 122 | + # The URI for the proxy server to use |
| 123 | + ${Proxy}, |
| 124 | + |
| 125 | + [Parameter(DontShow, HelpMessage='Credentials for a proxy server to use for the remote call')] |
| 126 | + [ValidateNotNull()] |
| 127 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Runtime')] |
| 128 | + [System.Management.Automation.PSCredential] |
| 129 | + # Credentials for a proxy server to use for the remote call |
| 130 | + ${ProxyCredential}, |
| 131 | + |
| 132 | + [Parameter(DontShow, HelpMessage='Use the default credentials for the proxy')] |
| 133 | + [Microsoft.Azure.PowerShell.Cmdlets.Dns.Category('Runtime')] |
| 134 | + [System.Management.Automation.SwitchParameter] |
| 135 | + # Use the default credentials for the proxy |
| 136 | + ${ProxyUseDefaultCredentials} |
| 137 | +) |
| 138 | + |
| 139 | +process { |
| 140 | + if ($PSBoundParameters.ContainsKey('DoNotOverwrite')) { |
| 141 | + $null = $PSBoundParameters.Remove('DoNotOverwrite') |
| 142 | + $PSBoundParameters['IfNoneMatch'] = '*' |
| 143 | + } |
| 144 | + $PSBoundParameters['RecordType'] = [Microsoft.Azure.PowerShell.Cmdlets.Dns.Support.RecordType]::A |
| 145 | + Az.Dns.internal\New-AzDnsRecordSet @PSBoundParameters |
| 146 | +} |
| 147 | +} |
0 commit comments