@@ -22,70 +22,83 @@ Check whether the scopes from request is valid for `Reservation`.\n
22
22
. Example
23
23
Get-AzReservationAvailableScope -ReservationId 2ef560a7-f469-4b62-87b7-5312d588ce2a -ReservationOrderId 2b9b9372-24e1-4a07-a354-2078fe347cf9 -Scope "/subscriptions/3f0487ff-27ca-4b9c-2a23-000770724b1b"
24
24
25
- . Inputs
26
- Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest
27
25
. Inputs
28
26
Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity
29
27
. Outputs
30
- Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties
28
+ Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties
31
29
. Notes
32
30
COMPLEX PARAMETER PROPERTIES
33
31
34
32
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
35
33
36
- BODY <IAvailableScopeRequest>: Available scope
37
- [Scope <String[]>]:
38
-
39
34
INPUTOBJECT <IReservationsIdentity>: Identity Parameter
40
35
[Id <String>]: Resource identity path
41
36
[ReservationId <String>]: Id of the reservation item
42
37
[ReservationOrderId <String>]: Order Id of the reservation
43
38
[SubscriptionId <String>]: Id of the subscription
39
+
40
+ RESERVATIONORDERINPUTOBJECT <IReservationsIdentity>: Identity Parameter
41
+ [Id <String>]: Resource identity path
42
+ [ReservationId <String>]: Id of the reservation item
43
+ [ReservationOrderId <String>]: Order Id of the reservation
44
+ [SubscriptionId <String>]: Id of the subscription
44
45
. Link
45
46
https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationavailablescope
46
47
#>
47
48
function Get-AzReservationAvailableScope {
48
- [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties ])]
49
+ [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties ])]
49
50
[CmdletBinding (DefaultParameterSetName = ' AvailableExpanded' , PositionalBinding = $false , SupportsShouldProcess , ConfirmImpact = ' Medium' )]
50
51
param (
51
- [Parameter (ParameterSetName = ' Available' , Mandatory )]
52
52
[Parameter (ParameterSetName = ' AvailableExpanded' , Mandatory )]
53
+ [Parameter (ParameterSetName = ' AvailableViaIdentityReservationOrderExpanded' , Mandatory )]
54
+ [Parameter (ParameterSetName = ' AvailableViaJsonFilePath' , Mandatory )]
55
+ [Parameter (ParameterSetName = ' AvailableViaJsonString' , Mandatory )]
53
56
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Path' )]
54
57
[System.String ]
55
58
# Id of the reservation item
56
59
${ReservationId} ,
57
60
58
- [Parameter (ParameterSetName = ' Available' , Mandatory )]
59
61
[Parameter (ParameterSetName = ' AvailableExpanded' , Mandatory )]
62
+ [Parameter (ParameterSetName = ' AvailableViaJsonFilePath' , Mandatory )]
63
+ [Parameter (ParameterSetName = ' AvailableViaJsonString' , Mandatory )]
60
64
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Path' )]
61
65
[System.String ]
62
66
# Order Id of the reservation
63
67
${ReservationOrderId} ,
64
68
65
- [Parameter (ParameterSetName = ' AvailableViaIdentity' , Mandatory , ValueFromPipeline )]
66
69
[Parameter (ParameterSetName = ' AvailableViaIdentityExpanded' , Mandatory , ValueFromPipeline )]
67
70
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Path' )]
68
71
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity ]
69
72
# Identity Parameter
70
- # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
71
73
${InputObject} ,
72
74
73
- [Parameter (ParameterSetName = ' Available' , Mandatory , ValueFromPipeline )]
74
- [Parameter (ParameterSetName = ' AvailableViaIdentity' , Mandatory , ValueFromPipeline )]
75
- [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Body' )]
76
- [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest ]
77
- # Available scope
78
- # To construct, see NOTES section for BODY properties and create a hash table.
79
- ${Body} ,
75
+ [Parameter (ParameterSetName = ' AvailableViaIdentityReservationOrderExpanded' , Mandatory , ValueFromPipeline )]
76
+ [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Path' )]
77
+ [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity ]
78
+ # Identity Parameter
79
+ ${ReservationOrderInputObject} ,
80
80
81
81
[Parameter (ParameterSetName = ' AvailableExpanded' )]
82
82
[Parameter (ParameterSetName = ' AvailableViaIdentityExpanded' )]
83
+ [Parameter (ParameterSetName = ' AvailableViaIdentityReservationOrderExpanded' )]
83
84
[AllowEmptyCollection ()]
84
85
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Body' )]
85
86
[System.String []]
86
87
# .
87
88
${Scope} ,
88
89
90
+ [Parameter (ParameterSetName = ' AvailableViaJsonFilePath' , Mandatory )]
91
+ [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Body' )]
92
+ [System.String ]
93
+ # Path of Json file supplied to the Available operation
94
+ ${JsonFilePath} ,
95
+
96
+ [Parameter (ParameterSetName = ' AvailableViaJsonString' , Mandatory )]
97
+ [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Body' )]
98
+ [System.String ]
99
+ # Json string supplied to the Available operation
100
+ ${JsonString} ,
101
+
89
102
[Parameter ()]
90
103
[Alias (' AzureRMContext' , ' AzureCredential' )]
91
104
[ValidateNotNull ()]
@@ -154,6 +167,15 @@ begin {
154
167
$PSBoundParameters [' OutBuffer' ] = 1
155
168
}
156
169
$parameterSet = $PSCmdlet.ParameterSetName
170
+
171
+ $testPlayback = $false
172
+ $PSBoundParameters [' HttpPipelinePrepend' ] | Foreach-Object { if ($_ ) { $testPlayback = $testPlayback -or (' Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType ().FullName -and ' Playback' -eq $_.Target.Mode ) } }
173
+
174
+ $context = Get-AzContext
175
+ if (-not $context -and -not $testPlayback ) {
176
+ Write-Error " No Azure login detected. Please run 'Connect-AzAccount' to log in."
177
+ exit
178
+ }
157
179
158
180
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PowerShellVersion) {
159
181
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PowerShellVersion = $PSVersionTable.PSVersion.ToString ()
@@ -173,10 +195,11 @@ begin {
173
195
}
174
196
175
197
$mapping = @ {
176
- Available = ' Az.Reservations.private\Get-AzReservationAvailableScope_Available' ;
177
198
AvailableExpanded = ' Az.Reservations.private\Get-AzReservationAvailableScope_AvailableExpanded' ;
178
- AvailableViaIdentity = ' Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaIdentity' ;
179
199
AvailableViaIdentityExpanded = ' Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaIdentityExpanded' ;
200
+ AvailableViaIdentityReservationOrderExpanded = ' Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaIdentityReservationOrderExpanded' ;
201
+ AvailableViaJsonFilePath = ' Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaJsonFilePath' ;
202
+ AvailableViaJsonString = ' Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaJsonString' ;
180
203
}
181
204
$cmdInfo = Get-Command - Name $mapping [$parameterSet ]
182
205
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper ]::ProcessCustomAttributesAtRuntime($cmdInfo , $MyInvocation , $parameterSet , $PSCmdlet )
@@ -185,6 +208,9 @@ begin {
185
208
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name )
186
209
}
187
210
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand (($mapping [$parameterSet ]), [System.Management.Automation.CommandTypes ]::Cmdlet)
211
+ if ($wrappedCmd -eq $null ) {
212
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand (($mapping [$parameterSet ]), [System.Management.Automation.CommandTypes ]::Function)
213
+ }
188
214
$scriptCmd = {& $wrappedCmd @PSBoundParameters }
189
215
$steppablePipeline = $scriptCmd.GetSteppablePipeline ($MyInvocation.CommandOrigin )
190
216
$steppablePipeline.Begin ($PSCmdlet )
0 commit comments