|
| 1 | + |
| 2 | +# ---------------------------------------------------------------------------------- |
| 3 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# Unless required by applicable law or agreed to in writing, software |
| 9 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | +# See the License for the specific language governing permissions and |
| 12 | +# limitations under the License. |
| 13 | +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code |
| 14 | +# is regenerated. |
| 15 | +# ---------------------------------------------------------------------------------- |
| 16 | + |
| 17 | +<# |
| 18 | +.Synopsis |
| 19 | +Gets list of current NetworkSecurityPerimeterConfiguration for Namespace |
| 20 | +.Description |
| 21 | +Gets list of current NetworkSecurityPerimeterConfiguration for Namespace |
| 22 | +.Example |
| 23 | +Get-AzEventHubNetworkSecurityPerimeterConfiguration -ResourceGroupName myResourceGroup -NamespaceName myNamespace |
| 24 | +
|
| 25 | +.Outputs |
| 26 | +Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.INetworkSecurityPerimeterConfigurationList |
| 27 | +.Link |
| 28 | +https://learn.microsoft.com/powershell/module/az.eventhub/get-azeventhubnetworksecurityperimeterconfiguration |
| 29 | +#> |
| 30 | +function Get-AzEventHubNetworkSecurityPerimeterConfiguration { |
| 31 | +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.INetworkSecurityPerimeterConfigurationList])] |
| 32 | +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] |
| 33 | +param( |
| 34 | + [Parameter(Mandatory)] |
| 35 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Path')] |
| 36 | + [System.String] |
| 37 | + # The Namespace name |
| 38 | + ${NamespaceName}, |
| 39 | + |
| 40 | + [Parameter(Mandatory)] |
| 41 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Path')] |
| 42 | + [System.String] |
| 43 | + # Name of the resource group within the azure subscription. |
| 44 | + ${ResourceGroupName}, |
| 45 | + |
| 46 | + [Parameter()] |
| 47 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Path')] |
| 48 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] |
| 49 | + [System.String[]] |
| 50 | + # Subscription credentials that uniquely identify a Microsoft Azure subscription. |
| 51 | + # The subscription ID forms part of the URI for every service call. |
| 52 | + ${SubscriptionId}, |
| 53 | + |
| 54 | + [Parameter()] |
| 55 | + [Alias('AzureRMContext', 'AzureCredential')] |
| 56 | + [ValidateNotNull()] |
| 57 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Azure')] |
| 58 | + [System.Management.Automation.PSObject] |
| 59 | + # The DefaultProfile parameter is not functional. |
| 60 | + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. |
| 61 | + ${DefaultProfile}, |
| 62 | + |
| 63 | + [Parameter(DontShow)] |
| 64 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Runtime')] |
| 65 | + [System.Management.Automation.SwitchParameter] |
| 66 | + # Wait for .NET debugger to attach |
| 67 | + ${Break}, |
| 68 | + |
| 69 | + [Parameter(DontShow)] |
| 70 | + [ValidateNotNull()] |
| 71 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Runtime')] |
| 72 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Runtime.SendAsyncStep[]] |
| 73 | + # SendAsync Pipeline Steps to be appended to the front of the pipeline |
| 74 | + ${HttpPipelineAppend}, |
| 75 | + |
| 76 | + [Parameter(DontShow)] |
| 77 | + [ValidateNotNull()] |
| 78 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Runtime')] |
| 79 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Runtime.SendAsyncStep[]] |
| 80 | + # SendAsync Pipeline Steps to be prepended to the front of the pipeline |
| 81 | + ${HttpPipelinePrepend}, |
| 82 | + |
| 83 | + [Parameter(DontShow)] |
| 84 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Runtime')] |
| 85 | + [System.Uri] |
| 86 | + # The URI for the proxy server to use |
| 87 | + ${Proxy}, |
| 88 | + |
| 89 | + [Parameter(DontShow)] |
| 90 | + [ValidateNotNull()] |
| 91 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Runtime')] |
| 92 | + [System.Management.Automation.PSCredential] |
| 93 | + # Credentials for a proxy server to use for the remote call |
| 94 | + ${ProxyCredential}, |
| 95 | + |
| 96 | + [Parameter(DontShow)] |
| 97 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Runtime')] |
| 98 | + [System.Management.Automation.SwitchParameter] |
| 99 | + # Use the default credentials for the proxy |
| 100 | + ${ProxyUseDefaultCredentials} |
| 101 | +) |
| 102 | + |
| 103 | +begin { |
| 104 | + try { |
| 105 | + $outBuffer = $null |
| 106 | + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { |
| 107 | + $PSBoundParameters['OutBuffer'] = 1 |
| 108 | + } |
| 109 | + $parameterSet = $PSCmdlet.ParameterSetName |
| 110 | + |
| 111 | + $testPlayback = $false |
| 112 | + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.EventHub.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } |
| 113 | + |
| 114 | + $context = Get-AzContext |
| 115 | + if (-not $context -and -not $testPlayback) { |
| 116 | + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." |
| 117 | + exit |
| 118 | + } |
| 119 | + |
| 120 | + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { |
| 121 | + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() |
| 122 | + } |
| 123 | + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId |
| 124 | + if ($preTelemetryId -eq '') { |
| 125 | + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() |
| 126 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) |
| 127 | + } else { |
| 128 | + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets |
| 129 | + if ($internalCalledCmdlets -eq '') { |
| 130 | + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name |
| 131 | + } else { |
| 132 | + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name |
| 133 | + } |
| 134 | + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' |
| 135 | + } |
| 136 | + |
| 137 | + $mapping = @{ |
| 138 | + List = 'Az.EventHub.private\Get-AzEventHubNetworkSecurityPerimeterConfiguration_List'; |
| 139 | + } |
| 140 | + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { |
| 141 | + if ($testPlayback) { |
| 142 | + $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') |
| 143 | + } else { |
| 144 | + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id |
| 145 | + } |
| 146 | + } |
| 147 | + $cmdInfo = Get-Command -Name $mapping[$parameterSet] |
| 148 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) |
| 149 | + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ |
| 150 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) |
| 151 | + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) |
| 152 | + } |
| 153 | + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) |
| 154 | + if ($wrappedCmd -eq $null) { |
| 155 | + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) |
| 156 | + } |
| 157 | + $scriptCmd = {& $wrappedCmd @PSBoundParameters} |
| 158 | + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) |
| 159 | + $steppablePipeline.Begin($PSCmdlet) |
| 160 | + } catch { |
| 161 | + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() |
| 162 | + throw |
| 163 | + } |
| 164 | +} |
| 165 | + |
| 166 | +process { |
| 167 | + try { |
| 168 | + $steppablePipeline.Process($_) |
| 169 | + } catch { |
| 170 | + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() |
| 171 | + throw |
| 172 | + } |
| 173 | + |
| 174 | + finally { |
| 175 | + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId |
| 176 | + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets |
| 177 | + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() |
| 178 | + } |
| 179 | + |
| 180 | +} |
| 181 | +end { |
| 182 | + try { |
| 183 | + $steppablePipeline.End() |
| 184 | + |
| 185 | + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId |
| 186 | + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets |
| 187 | + if ($preTelemetryId -eq '') { |
| 188 | + [Microsoft.Azure.PowerShell.Cmdlets.EventHub.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) |
| 189 | + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() |
| 190 | + } |
| 191 | + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId |
| 192 | + |
| 193 | + } catch { |
| 194 | + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() |
| 195 | + throw |
| 196 | + } |
| 197 | +} |
| 198 | +} |
0 commit comments