@@ -22,70 +22,83 @@ Check whether the scopes from request is valid for `Reservation`.\n
2222. Example
2323Get-AzReservationAvailableScope -ReservationId 2ef560a7-f469-4b62-87b7-5312d588ce2a -ReservationOrderId 2b9b9372-24e1-4a07-a354-2078fe347cf9 -Scope "/subscriptions/3f0487ff-27ca-4b9c-2a23-000770724b1b"
2424
25- . Inputs
26- Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest
2725. Inputs
2826Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity
2927. Outputs
30- Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties
28+ Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties
3129. Notes
3230COMPLEX PARAMETER PROPERTIES
3331
3432To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
3533
36- BODY <IAvailableScopeRequest>: Available scope
37- [Scope <String[]>]:
38-
3934INPUTOBJECT <IReservationsIdentity>: Identity Parameter
4035 [Id <String>]: Resource identity path
4136 [ReservationId <String>]: Id of the reservation item
4237 [ReservationOrderId <String>]: Order Id of the reservation
4338 [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
4445. Link
4546https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationavailablescope
4647#>
4748function Get-AzReservationAvailableScope {
48- [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties ])]
49+ [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties ])]
4950[CmdletBinding (DefaultParameterSetName = ' AvailableExpanded' , PositionalBinding = $false , SupportsShouldProcess , ConfirmImpact = ' Medium' )]
5051param (
51- [Parameter (ParameterSetName = ' Available' , Mandatory )]
5252 [Parameter (ParameterSetName = ' AvailableExpanded' , Mandatory )]
53+ [Parameter (ParameterSetName = ' AvailableViaIdentityReservationOrderExpanded' , Mandatory )]
54+ [Parameter (ParameterSetName = ' AvailableViaJsonFilePath' , Mandatory )]
55+ [Parameter (ParameterSetName = ' AvailableViaJsonString' , Mandatory )]
5356 [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Path' )]
5457 [System.String ]
5558 # Id of the reservation item
5659 ${ReservationId} ,
5760
58- [Parameter (ParameterSetName = ' Available' , Mandatory )]
5961 [Parameter (ParameterSetName = ' AvailableExpanded' , Mandatory )]
62+ [Parameter (ParameterSetName = ' AvailableViaJsonFilePath' , Mandatory )]
63+ [Parameter (ParameterSetName = ' AvailableViaJsonString' , Mandatory )]
6064 [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Path' )]
6165 [System.String ]
6266 # Order Id of the reservation
6367 ${ReservationOrderId} ,
6468
65- [Parameter (ParameterSetName = ' AvailableViaIdentity' , Mandatory , ValueFromPipeline )]
6669 [Parameter (ParameterSetName = ' AvailableViaIdentityExpanded' , Mandatory , ValueFromPipeline )]
6770 [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Path' )]
6871 [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity ]
6972 # Identity Parameter
70- # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
7173 ${InputObject} ,
7274
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} ,
8080
8181 [Parameter (ParameterSetName = ' AvailableExpanded' )]
8282 [Parameter (ParameterSetName = ' AvailableViaIdentityExpanded' )]
83+ [Parameter (ParameterSetName = ' AvailableViaIdentityReservationOrderExpanded' )]
8384 [AllowEmptyCollection ()]
8485 [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Body' )]
8586 [System.String []]
8687 # .
8788 ${Scope} ,
8889
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+
89102 [Parameter ()]
90103 [Alias (' AzureRMContext' , ' AzureCredential' )]
91104 [ValidateNotNull ()]
@@ -154,6 +167,15 @@ begin {
154167 $PSBoundParameters [' OutBuffer' ] = 1
155168 }
156169 $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+ }
157179
158180 if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PowerShellVersion) {
159181 [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PowerShellVersion = $PSVersionTable.PSVersion.ToString ()
@@ -173,10 +195,11 @@ begin {
173195 }
174196
175197 $mapping = @ {
176- Available = ' Az.Reservations.private\Get-AzReservationAvailableScope_Available' ;
177198 AvailableExpanded = ' Az.Reservations.private\Get-AzReservationAvailableScope_AvailableExpanded' ;
178- AvailableViaIdentity = ' Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaIdentity' ;
179199 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' ;
180203 }
181204 $cmdInfo = Get-Command - Name $mapping [$parameterSet ]
182205 [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper ]::ProcessCustomAttributesAtRuntime($cmdInfo , $MyInvocation , $parameterSet , $PSCmdlet )
@@ -185,6 +208,9 @@ begin {
185208 [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name )
186209 }
187210 $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+ }
188214 $scriptCmd = {& $wrappedCmd @PSBoundParameters }
189215 $steppablePipeline = $scriptCmd.GetSteppablePipeline ($MyInvocation.CommandOrigin )
190216 $steppablePipeline.Begin ($PSCmdlet )
0 commit comments