-
Notifications
You must be signed in to change notification settings - Fork 4.3k
[Change Safety] Fix forwarding in read-modify-write cmdlets #30211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Yabo Hu (VeryEarly)
merged 13 commits into
Azure:main
from
YangAn-microsoft:fix/change-safety-read-parameter-forwarding
Sep 29, 2026
+340
−126
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7533e67
Fix Change Safety forwarding in read-modify-write cmdlets
YangAn-microsoft 68447eb
Inline read parameter metadata filtering
YangAn-microsoft c80d943
Restore shared read parameter helpers
YangAn-microsoft 770b0b9
Remove redundant Change Safety changelog entries
YangAn-microsoft 7b4460f
Preserve existing bound parameter flow
YangAn-microsoft e56c477
Forward Change Safety in GeoDR identity actions
YangAn-microsoft 31a4334
Filter Change Safety parameters from CDN reads
YangAn-microsoft 09e7708
Fix GeoDR dynamic parameter dictionary lookup
YangAn-microsoft f9356b8
Strengthen CDN read alias regression test
YangAn-microsoft 7a6a9fa
Merge Azure main into Change Safety fix
YangAn-microsoft 93a564e
Fix forwarding tests in packaged modules
YangAn-microsoft 55cdb03
Restore Network changelog spacing
YangAn-microsoft ab9c426
Add forwarding fix changelogs
YangAn-microsoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/EventHub/EventHub.Autorest/custom/Add-AzEventHubBoundDynamicParameter.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/EventHub/EventHub.Autorest/custom/Get-AzEventHubReadParameters.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| function Get-AzEventHubReadParameters { | ||
| [Microsoft.Azure.PowerShell.Cmdlets.EventHub.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 | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.