Skip to content

Commit 7107fec

Browse files
Migrate KeyVault from generation to release-2023-11-14 (#23307)
* Move KeyVault to release-2023-11-14 * Update ChangeLog.md --------- Co-authored-by: Yabo Hu <[email protected]>
1 parent 923808a commit 7107fec

File tree

84 files changed

+651
-258
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+651
-258
lines changed

src/KeyVault/KeyVault.Autorest/build-module.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,10 @@ Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFol
171171
Write-Host -ForegroundColor Green 'Creating example stubs...'
172172
Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder
173173

174+
if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
175+
{
176+
Write-Host -ForegroundColor Green 'Creating ux metadata...'
177+
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
178+
}
179+
174180
Write-Host -ForegroundColor Green '-------------Done-------------'

src/KeyVault/KeyVault.Autorest/custom/Add-AzKeyVaultManagedHsmRegion.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ function Add-AzKeyVaultManagedHsmRegion {
120120
$null = $PSBoundParameters.Add('Name', $HsmName)
121121
$null = $PSBoundParameters.Remove('Region')
122122
$Parameter = Az.KeyVault.internal\Get-AzKeyVaultManagedHsm @PSBoundParameters
123-
for ($i = 0; $i -lt $Region.Count; $i++) {
124-
$Parameter.Region += New-Object Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmGeoReplicatedRegion -Property @{Name = $Region[$i]}
125-
}
123+
$Parameter = Az.KeyVault.private\Get-ParameterForRegion -Parameter $Parameter -Region $Region
126124
$null = $PSBoundParameters.Add('Parameter', $Parameter)
127125
$null = Az.KeyVault.internal\Update-AzKeyVaultManagedHsm @PSBoundParameters
128126
$null = $PSBoundParameters.Remove('Parameter')
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
5+
6+
namespace Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Cmdlets
7+
{
8+
using static Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Extensions;
9+
using Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.PowerShell;
10+
using Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Cmdlets;
11+
using System;
12+
using System.Management.Automation;
13+
using System.Collections;
14+
using System.Collections.Generic;
15+
using System.Linq;
16+
17+
[global::Microsoft.Azure.PowerShell.Cmdlets.KeyVault.InternalExport]
18+
[global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"ParameterForRegion")]
19+
[global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IManagedHsm))]
20+
[global::Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Description(@"Create an in-memory object for parameter region.")]
21+
[global::Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Generated]
22+
public partial class GetAzKeyVaultManagedHsmRegionObject : global::System.Management.Automation.PSCmdlet
23+
{
24+
/// <summary>Backing field for <see cref="Parameter" /> property.</summary>
25+
private Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IManagedHsm _parameter;
26+
27+
/// <summary>Resource information with extended details.</summary>
28+
[global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Resource information with extended details.", ValueFromPipeline = true)]
29+
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Info(
30+
Required = true,
31+
ReadOnly = false,
32+
Description = @"Resource information with extended details.",
33+
SerializedName = @"parameters",
34+
PossibleTypes = new[] { typeof(Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IManagedHsm) })]
35+
[global::Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category(global::Microsoft.Azure.PowerShell.Cmdlets.KeyVault.ParameterCategory.Body)]
36+
public Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.IManagedHsm Parameter { get => this._parameter; set => this._parameter = value; }
37+
38+
/// <summary>Backing field for <see cref="Region" /> property.</summary>
39+
private string[] _region;
40+
41+
/// <summary>
42+
/// List of all regions associated with the managed hsm pool.
43+
/// </summary>
44+
[global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "List of all regions associated with the managed hsm pool.")]
45+
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.Info(
46+
Required = true,
47+
ReadOnly = false,
48+
Description = @"List of all regions associated with the managed hsm pool.",
49+
PossibleTypes = new[] { typeof(string) })]
50+
[global::Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Category(global::Microsoft.Azure.PowerShell.Cmdlets.KeyVault.ParameterCategory.Path)]
51+
public string[] Region { get => this._region; set => this._region = value; }
52+
53+
[global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specify if add or remove regions to existing regions")]
54+
public SwitchParameter RemoveRegion;
55+
56+
/// <summary>Performs execution of the command.</summary>
57+
protected override void ProcessRecord()
58+
{
59+
if (RemoveRegion.IsPresent)
60+
{
61+
var remainingRegions = this.Parameter.Region?.Where(r => !this.Region.Contains(r.Name, StringComparer.OrdinalIgnoreCase));
62+
this.Parameter.Region = remainingRegions?.ToList();
63+
}
64+
else
65+
{
66+
foreach (var r in this.Region)
67+
{
68+
this.Parameter.Region.Add(new Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Models.MhsmGeoReplicatedRegion(new Dictionary<string, string>{{ "Name", r }}));
69+
70+
}
71+
}
72+
WriteObject(this.Parameter);
73+
}
74+
75+
}
76+
}

src/KeyVault/KeyVault.Autorest/custom/Remove-AzKeyVaultManagedHsmRegion.ps1

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,19 +126,13 @@ function Remove-AzKeyVaultManagedHsmRegion {
126126
$null = $PSBoundParameters.Add('Name', $HsmName)
127127
$null = $PSBoundParameters.Remove('Region')
128128
$Parameter = Az.KeyVault.internal\Get-AzKeyVaultManagedHsm @PSBoundParameters
129-
$remainingRegions = @()
130-
for ($i = 0; $i -lt $Parameter.Region.Count; $i++) {
131-
if($Region -notcontains $Parameter.Region[$i].Name){
132-
$remainingRegions += $Parameter.Region[$i]
133-
}
134-
}
135-
$Parameter.Region = $remainingRegions
136-
$null = $PSBoundParameters.Add('Parameter', $Parameter)
129+
$Parameter = Az.KeyVault.private\Get-ParameterForRegion -Parameter $Parameter -Region $Region -RemoveRegion
130+
$null = $PSBoundParameters.Add('Parameter', $Parameter)
137131
$null = Az.KeyVault.internal\Update-AzKeyVaultManagedHsm @PSBoundParameters
138-
$null = $PSBoundParameters.Remove('Parameter')
139-
$null = $PSBoundParameters.Remove('Name')
140-
$null = $PSBoundParameters.Add('HsmName', $HsmName)
141132
if($PassThru.IsPresent){
133+
$null = $PSBoundParameters.Remove('Parameter')
134+
$null = $PSBoundParameters.Remove('Name')
135+
$null = $PSBoundParameters.Add('HsmName', $HsmName)
142136
Az.KeyVault\Get-AzKeyVaultManagedHsmRegion @PSBoundParameters
143137
}
144138
} catch {

src/KeyVault/KeyVault.Autorest/exports/Add-AzKeyVaultManagedHsmRegion.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ begin {
145145
}
146146
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
147147
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
148+
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
149+
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
150+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
151+
}
148152
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
149153
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
150154
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)

src/KeyVault/KeyVault.Autorest/exports/Get-AzKeyVaultManagedHsmRegion.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ begin {
133133
}
134134
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
135135
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
136+
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
137+
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
138+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
139+
}
136140
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
137141
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
138142
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)

src/KeyVault/KeyVault.Autorest/exports/ProxyCmdletDefinitions.ps1

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ begin {
133133
}
134134
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
135135
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
136+
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
137+
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
138+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
139+
}
136140
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
137141
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
138142
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -306,6 +310,10 @@ begin {
306310
}
307311
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
308312
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
313+
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
314+
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
315+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
316+
}
309317
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
310318
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
311319
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -479,6 +487,10 @@ begin {
479487
}
480488
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
481489
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
490+
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
491+
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
492+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
493+
}
482494
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
483495
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
484496
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -654,6 +666,10 @@ begin {
654666
}
655667
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
656668
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
669+
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
670+
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
671+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
672+
}
657673
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
658674
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
659675
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
@@ -835,6 +851,10 @@ begin {
835851
}
836852
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
837853
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
854+
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
855+
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
856+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
857+
}
838858
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
839859
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
840860
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)

src/KeyVault/KeyVault.Autorest/exports/Remove-AzKeyVaultManagedHsmRegion.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ begin {
151151
}
152152
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
153153
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
154+
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
155+
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
156+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
157+
}
154158
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
155159
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
156160
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)

src/KeyVault/KeyVault.Autorest/exports/Test-AzKeyVaultManagedHsmNameAvailability.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ begin {
143143
}
144144
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
145145
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
146+
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
147+
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
148+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
149+
}
146150
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
147151
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
148152
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)

src/KeyVault/KeyVault.Autorest/exports/Test-AzKeyVaultNameAvailability.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ begin {
143143
}
144144
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
145145
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
146+
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
147+
[Microsoft.Azure.PowerShell.Cmdlets.KeyVault.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
148+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
149+
}
146150
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
147151
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
148152
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)

0 commit comments

Comments
 (0)