Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/Cdn/Cdn.Autorest/custom/Get-AzCdnReadParameters.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
function Get-AzCdnReadParameters {
[Microsoft.Azure.PowerShell.Cmdlets.Cdn.DoNotExportAttribute()]
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[System.String]
${CommandName},

[Parameter(Mandatory)]
[System.Collections.IDictionary]
${BoundParameters}
)

$command = @(Get-Command -Name $CommandName -ErrorAction Stop)[0]
while ($command.CommandType -eq [System.Management.Automation.CommandTypes]::Alias) {
$command = Get-Command -Name $command.ResolvedCommandName -ErrorAction Stop
}

$parameterNames = @($command.Parameters.Keys)
$parameterNames += @($command.Parameters.Values | ForEach-Object { $_.Aliases })

$readParameters = @{}
foreach ($parameter in $BoundParameters.GetEnumerator()) {
if ($parameter.Key -in $parameterNames) {
$readParameters[$parameter.Key] = $parameter.Value
}
}

return $readParameters
}
6 changes: 4 additions & 2 deletions src/Cdn/Cdn.Autorest/custom/Remove-AzCdnProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,11 @@ function Remove-AzCdnProfile {
$hasPassThru = $PSBoundParameters.Remove('PassThru')

if ($PSCmdlet.ParameterSetName -eq 'Delete') {
$cdnProfile = Get-AzCdnProfile @PSBoundParameters
$readParameters = Get-AzCdnReadParameters -CommandName 'Get-AzCdnProfile' -BoundParameters $PSBoundParameters
$cdnProfile = Get-AzCdnProfile @readParameters
} elseif ($PSCmdlet.ParameterSetName -eq 'DeleteViaIdentity') {
$cdnProfile = Get-AzCdnProfile @PSBoundParameters
$readParameters = Get-AzCdnReadParameters -CommandName 'Get-AzCdnProfile' -BoundParameters $PSBoundParameters
$cdnProfile = Get-AzCdnProfile @readParameters
} else {
throw "Not supported ParameterSetName."
}
Expand Down
6 changes: 4 additions & 2 deletions src/Cdn/Cdn.Autorest/custom/Remove-AzFrontDoorCdnProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,11 @@ function Remove-AzFrontDoorCdnProfile {
$hasPassThru = $PSBoundParameters.Remove('PassThru')

if ($PSCmdlet.ParameterSetName -eq 'Delete') {
$frontDoorCdnProfile = Get-AzFrontDoorCdnProfile @PSBoundParameters
$readParameters = Get-AzCdnReadParameters -CommandName 'Get-AzFrontDoorCdnProfile' -BoundParameters $PSBoundParameters
$frontDoorCdnProfile = Get-AzFrontDoorCdnProfile @readParameters
} elseif ($PSCmdlet.ParameterSetName -eq 'DeleteViaIdentity') {
$frontDoorCdnProfile = Get-AzFrontDoorCdnProfile @PSBoundParameters
$readParameters = Get-AzCdnReadParameters -CommandName 'Get-AzFrontDoorCdnProfile' -BoundParameters $PSBoundParameters
$frontDoorCdnProfile = Get-AzFrontDoorCdnProfile @readParameters
} else {
throw "Not supported ParameterSetName."
}
Expand Down
6 changes: 4 additions & 2 deletions src/Cdn/Cdn.Autorest/custom/Update-AzCdnProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@ function Update-AzCdnProfile {
$hasNoWait = $PSBoundParameters.Remove('NoWait')

if ($PSCmdlet.ParameterSetName -eq 'UpdateExpanded') {
$cdnProfile = Get-AzCdnProfile @PSBoundParameters
$readParameters = Get-AzCdnReadParameters -CommandName 'Get-AzCdnProfile' -BoundParameters $PSBoundParameters
$cdnProfile = Get-AzCdnProfile @readParameters
} elseif ($PSCmdlet.ParameterSetName -eq 'UpdateViaIdentityExpanded') {
$cdnProfile = Get-AzCdnProfile @PSBoundParameters
$readParameters = Get-AzCdnReadParameters -CommandName 'Get-AzCdnProfile' -BoundParameters $PSBoundParameters
$cdnProfile = Get-AzCdnProfile @readParameters
} else {
throw "Not supported ParameterSetName."
}
Expand Down
6 changes: 4 additions & 2 deletions src/Cdn/Cdn.Autorest/custom/Update-AzFrontDoorCdnProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,11 @@ function Update-AzFrontDoorCdnProfile {
$hasLogScrubbingState = $PSBoundParameters.Remove('LogScrubbingState')

if ($PSCmdlet.ParameterSetName -eq 'UpdateExpanded') {
$frontDoorCdnProfile = Get-AzFrontDoorCdnProfile @PSBoundParameters
$readParameters = Get-AzCdnReadParameters -CommandName 'Get-AzFrontDoorCdnProfile' -BoundParameters $PSBoundParameters
$frontDoorCdnProfile = Get-AzFrontDoorCdnProfile @readParameters
} elseif ($PSCmdlet.ParameterSetName -eq 'UpdateViaIdentityExpanded') {
$frontDoorCdnProfile = Get-AzFrontDoorCdnProfile @PSBoundParameters
$readParameters = Get-AzCdnReadParameters -CommandName 'Get-AzFrontDoorCdnProfile' -BoundParameters $PSBoundParameters
$frontDoorCdnProfile = Get-AzFrontDoorCdnProfile @readParameters
} else {
throw "Not supported ParameterSetName."
}
Expand Down
2 changes: 1 addition & 1 deletion src/Cdn/Cdn.Autorest/generate-info.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"generate_Id": "39d7c1e4-7bfb-4e14-a49a-ba3e1c9354f5"
"generate_Id": "57914f66-0713-43e5-b23f-da61694bdbae"
}
2 changes: 1 addition & 1 deletion src/Cdn/Cdn/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

## Upcoming Release

* Fixed Change Safety parameter forwarding in custom read-before-write cmdlets.
* Documented the planned removal of standalone EdgeAction resource cmdlets in Az.Cdn 7.0.0 and Az 17.0.0 on November 15, 2026. This advance announcement did not change cmdlet behavior or add runtime warnings; EdgeAction delivery-rule actions and URL signing are not affected.
* Added post-migration endpoint cutover guidance for Azure Front Door (classic) and Azure CDN from Microsoft (classic) migrations.

Expand Down Expand Up @@ -159,4 +160,3 @@ Fixed enabling CDN custom domain HTTPS for Microsoft and Akamai SKU's

## Version 1.0.0
* General availability of `Az.Cdn` module

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
function Add-AzEventHubBoundDynamicParameter {
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.DoNotExportAttribute()]
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[System.String]
${CommandName},

[Parameter(Mandatory)]
[System.Collections.IDictionary]
${BoundParameters},

[Parameter(Mandatory)]
[System.Collections.IDictionary]
${TargetParameters},

[System.String[]]
${ExcludedParameter}
)

$command = @(Get-Command -Name $CommandName -ErrorAction Stop)[0]
while ($command.CommandType -eq [System.Management.Automation.CommandTypes]::Alias) {
$command = Get-Command -Name $command.ResolvedCommandName -ErrorAction Stop
}

if (-not [System.Management.Automation.IDynamicParameters].IsAssignableFrom($command.ImplementingType)) {
return
}

$instance = [System.Activator]::CreateInstance($command.ImplementingType)
foreach ($parameterName in $instance.GetDynamicParameters().Keys) {
if (($parameterName -notin $ExcludedParameter) -and $BoundParameters.ContainsKey($parameterName)) {
$TargetParameters[$parameterName] = $BoundParameters[$parameterName]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ function Approve-AzEventHubPrivateEndpointConnection{
$null = $PSBoundParameters.Remove('WhatIf')
$null = $PSBoundParameters.Remove('Confirm')

$connection = Get-AzEventHubPrivateEndpointConnection @PSBoundParameters

$readParameters = Get-AzEventHubReadParameters -CommandName 'Get-AzEventHubPrivateEndpointConnection' -BoundParameters $PSBoundParameters
$connection = Get-AzEventHubPrivateEndpointConnection @readParameters
$connection.ConnectionState = "Approved"

if($hasDescription){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ function Deny-AzEventHubPrivateEndpointConnection{
$null = $PSBoundParameters.Remove('WhatIf')
$null = $PSBoundParameters.Remove('Confirm')

$connection = Get-AzEventHubPrivateEndpointConnection @PSBoundParameters

$readParameters = Get-AzEventHubReadParameters -CommandName 'Get-AzEventHubPrivateEndpointConnection' -BoundParameters $PSBoundParameters
$connection = Get-AzEventHubPrivateEndpointConnection @readParameters
$connection.ConnectionState = "Rejected"

if($hasDescription){
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
function Get-AzEventHubReadParameters {
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.DoNotExportAttribute()]
Comment thread
YangAn-microsoft marked this conversation as resolved.
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[System.String]
${CommandName},

[Parameter(Mandatory)]
[System.Collections.IDictionary]
${BoundParameters}
)

$command = @(Get-Command -Name $CommandName -ErrorAction Stop)[0]
while ($command.CommandType -eq [System.Management.Automation.CommandTypes]::Alias) {
$command = Get-Command -Name $command.ResolvedCommandName -ErrorAction Stop
}

$parameterNames = @($command.Parameters.Keys)
$parameterNames += @($command.Parameters.Values | ForEach-Object { $_.Aliases })

$readParameters = @{}
foreach ($parameter in $BoundParameters.GetEnumerator()) {
if ($parameter.Key -in $parameterNames) {
$readParameters[$parameter.Key] = $parameter.Value
}
}

return $readParameters
}
6 changes: 3 additions & 3 deletions src/EventHub/EventHub.Autorest/custom/Set-AzEventHub.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function Set-AzEventHub{
[System.String]
# Resource id of the storage account to be used to create the blobs
${StorageAccountResourceId},

[Parameter(HelpMessage = "Blob naming convention for archive, e.g. {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order")]
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Category('Body')]
[System.String]
Expand Down Expand Up @@ -257,8 +257,8 @@ function Set-AzEventHub{
$null = $PSBoundParameters.Remove('WhatIf')
$null = $PSBoundParameters.Remove('Confirm')

$eventHub = Get-AzEventHub @PSBoundParameters

$readParameters = Get-AzEventHubReadParameters -CommandName 'Get-AzEventHub' -BoundParameters $PSBoundParameters
$eventHub = Get-AzEventHub @readParameters
# 2. PUT
$null = $PSBoundParameters.Remove('InputObject')
$null = $PSBoundParameters.Remove('ResourceGroupName')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function Set-AzEventHubApplicationGroup{
[Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.IApplicationGroupPolicy[]]
# List of group policies that define the behavior of application group. The policies can support resource governance scenarios such as limiting ingress or egress traffic.
${Policy},

[Parameter(HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
Expand Down Expand Up @@ -146,16 +146,15 @@ function Set-AzEventHubApplicationGroup{
}
process{
try{

$hasIsEnabled = $PSBoundParameters.Remove('IsEnabled')
$hasPolicy = $PSBoundParameters.Remove('Policy')
$hasClientAppGroupIdentifier = $PSBoundParameters.Remove('ClientAppGroupIdentifier')
$hasAsJob = $PSBoundParameters.Remove('AsJob')
$null = $PSBoundParameters.Remove('WhatIf')
$null = $PSBoundParameters.Remove('Confirm')

$appGroup = Get-AzEventHubApplicationGroup @PSBoundParameters

$readParameters = Get-AzEventHubReadParameters -CommandName 'Get-AzEventHubApplicationGroup' -BoundParameters $PSBoundParameters
$appGroup = Get-AzEventHubApplicationGroup @readParameters
# 2. PUT
$null = $PSBoundParameters.Remove('InputObject')
$null = $PSBoundParameters.Remove('ResourceGroupName')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function Set-AzEventHubAuthorizationRule{
[System.String[]]
# The rights associated with the rule.
${Rights},

[Parameter(HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
Expand Down Expand Up @@ -151,11 +151,13 @@ function Set-AzEventHubAuthorizationRule{
$null = $PSBoundParameters.Remove('Confirm')

if ($PSCmdlet.ParameterSetName -eq 'SetExpandedNamespace'){
$authRule = Az.EventHub.private\Get-AzEventHubNamespaceAuthorizationRule_Get @PSBoundParameters
$readParameters = Get-AzEventHubReadParameters -CommandName 'Az.EventHub.private\Get-AzEventHubNamespaceAuthorizationRule_Get' -BoundParameters $PSBoundParameters
$authRule = Az.EventHub.private\Get-AzEventHubNamespaceAuthorizationRule_Get @readParameters
}

elseif($PSCmdlet.ParameterSetName -eq 'SetExpandedEntity'){
$authRule = Az.EventHub.private\Get-AzEventHubAuthorizationRule_Get @PSBoundParameters
$readParameters = Get-AzEventHubReadParameters -CommandName 'Az.EventHub.private\Get-AzEventHubAuthorizationRule_Get' -BoundParameters $PSBoundParameters
$authRule = Az.EventHub.private\Get-AzEventHubAuthorizationRule_Get @readParameters
}

elseif ($PSCmdlet.ParameterSetName -eq 'SetViaIdentityExpanded'){
Expand All @@ -166,16 +168,18 @@ function Set-AzEventHubAuthorizationRule{
$ResourceHashTable = ParseResourceId -ResourceId $InputObject
}
if ($ResourceHashTable['EventHubName'] -ne $null){
$authRule = Az.EventHub.private\Get-AzEventHubAuthorizationRule_GetViaIdentity @PSBoundParameters
$readParameters = Get-AzEventHubReadParameters -CommandName 'Az.EventHub.private\Get-AzEventHubAuthorizationRule_GetViaIdentity' -BoundParameters $PSBoundParameters
$authRule = Az.EventHub.private\Get-AzEventHubAuthorizationRule_GetViaIdentity @readParameters
}
elseif ($ResourceHashTable['NamespaceName'] -ne $null){
$authRule = Az.EventHub.private\Get-AzEventHubNamespaceAuthorizationRule_GetViaIdentity @PSBoundParameters
$readParameters = Get-AzEventHubReadParameters -CommandName 'Az.EventHub.private\Get-AzEventHubNamespaceAuthorizationRule_GetViaIdentity' -BoundParameters $PSBoundParameters
$authRule = Az.EventHub.private\Get-AzEventHubNamespaceAuthorizationRule_GetViaIdentity @readParameters
}
else{
throw 'Invalid -InputObject. Please Check ResourceId'
}
}

# 2. PUT
$null = $PSBoundParameters.Remove('InputObject')
$null = $PSBoundParameters.Remove('ResourceGroupName')
Expand Down Expand Up @@ -203,9 +207,9 @@ function Set-AzEventHubAuthorizationRule{
}
}


elseif ($PSCmdlet.ParameterSetName -eq 'SetViaIdentityExpanded'){

if ($ResourceHashTable['EventHubName'] -ne $null){
if ($PSCmdlet.ShouldProcess("EventHub Entity Authorization Rule $($ResourceHashTable['AuthorizationRuleName'])", "Create or update")) {
Az.EventHub.private\New-AzEventHubAuthorizationRule_CreateViaIdentity -InputObject $authRule -Parameter $authRule @PSBoundParameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ function Set-AzEventHubCluster{
$null = $PSBoundParameters.Remove('WhatIf')
$null = $PSBoundParameters.Remove('Confirm')

$cluster = Get-AzEventHubCluster @PSBoundParameters

$readParameters = Get-AzEventHubReadParameters -CommandName 'Get-AzEventHubCluster' -BoundParameters $PSBoundParameters
$cluster = Get-AzEventHubCluster @readParameters
# 2. PUT
$null = $PSBoundParameters.Remove('InputObject')
$null = $PSBoundParameters.Remove('ResourceGroupName')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function Set-AzEventHubConsumerGroup{
[System.String]
# User Metadata is a placeholder to store user-defined string data with maximum length 1024. e.g. it can be used to store descriptive data, such as list of teams and their contact information also user-defined configuration settings can be stored.
${UserMetadata},

[Parameter(HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
Expand Down Expand Up @@ -146,8 +146,8 @@ function Set-AzEventHubConsumerGroup{
$null = $PSBoundParameters.Remove('WhatIf')
$null = $PSBoundParameters.Remove('Confirm')

$consumerGroup = Get-AzEventHubConsumerGroup @PSBoundParameters

$readParameters = Get-AzEventHubReadParameters -CommandName 'Get-AzEventHubConsumerGroup' -BoundParameters $PSBoundParameters
$consumerGroup = Get-AzEventHubConsumerGroup @readParameters
# 2. PUT
$null = $PSBoundParameters.Remove('InputObject')
$null = $PSBoundParameters.Remove('ResourceGroupName')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function Set-AzEventHubGeoDRConfigurationBreakPair{
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter(HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
Expand Down Expand Up @@ -131,8 +131,8 @@ function Set-AzEventHubGeoDRConfigurationBreakPair{
$null = $PSBoundParameters.Remove('WhatIf')
$null = $PSBoundParameters.Remove('Confirm')

$drConfig = Get-AzEventHubGeoDRConfiguration @PSBoundParameters

$readParameters = Get-AzEventHubReadParameters -CommandName 'Get-AzEventHubGeoDRConfiguration' -BoundParameters $PSBoundParameters
$drConfig = Get-AzEventHubGeoDRConfiguration @readParameters
# 2. PUT
$null = $PSBoundParameters.Remove('InputObject')

Expand Down Expand Up @@ -167,6 +167,8 @@ function Set-AzEventHubGeoDRConfigurationBreakPair{
$EnvPSBoundParameters['ProxyUseDefaultCredentials'] = $ProxyUseDefaultCredentials
}

Add-AzEventHubBoundDynamicParameter -CommandName 'Az.EventHub.private\Invoke-AzEventHubBreakDisasterRecoveryConfigPairing_Break' -BoundParameters $PSBoundParameters -TargetParameters $EnvPSBoundParameters -ExcludedParameter InputObject, Name, NamespaceName, ResourceGroupName, SubscriptionId

if($InputObject.Id -ne $null){
$ResourceHashTable = ParseResourceId -ResourceId $InputObject.Id
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function Set-AzEventHubGeoDRConfigurationFailOver{
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter(HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
Expand Down Expand Up @@ -131,8 +131,8 @@ function Set-AzEventHubGeoDRConfigurationFailOver{
$null = $PSBoundParameters.Remove('WhatIf')
$null = $PSBoundParameters.Remove('Confirm')

$drConfig = Get-AzEventHubGeoDRConfiguration @PSBoundParameters

$readParameters = Get-AzEventHubReadParameters -CommandName 'Get-AzEventHubGeoDRConfiguration' -BoundParameters $PSBoundParameters
$drConfig = Get-AzEventHubGeoDRConfiguration @readParameters
# 2. PUT
$null = $PSBoundParameters.Remove('InputObject')

Expand Down Expand Up @@ -167,6 +167,8 @@ function Set-AzEventHubGeoDRConfigurationFailOver{
$EnvPSBoundParameters['ProxyUseDefaultCredentials'] = $ProxyUseDefaultCredentials
}

Add-AzEventHubBoundDynamicParameter -CommandName 'Az.EventHub.private\Invoke-AzEventHubFailDisasterRecoveryConfigOver_Fail' -BoundParameters $PSBoundParameters -TargetParameters $EnvPSBoundParameters -ExcludedParameter InputObject, Name, NamespaceName, ResourceGroupName, SubscriptionId

if($InputObject.Id -ne $null){
$ResourceHashTable = ParseResourceId -ResourceId $InputObject.Id
}
Expand Down
Loading
Loading