11# ----------------------------------------------------------------------------------
22#
3- # Copyright Microsoft Corporation
3+ # Copyright (c) Microsoft Corporation. All rights reserved.
44# Licensed under the Apache License, Version 2.0 (the "License");
55# you may not use this file except in compliance with the License.
66# You may obtain a copy of the License at
1414
1515<#
1616. Synopsis
17- Return a Reservation .
17+ Return a reservation and get refund information .
1818. Description
19- Return a Reservation .
19+ Return a reservation and get refund information .
2020
2121. Inputs
2222Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity
2323. Outputs
24- Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse
25-
24+ Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse
25+ . Notes
26+ COMPLEX PARAMETER PROPERTIES
2627To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
2728
2829INPUTOBJECT <IReservationsIdentity>: Identity Parameter
2930 [Id <String>]: Resource identity path
3031 [ReservationId <String>]: Id of the reservation item
3132 [ReservationOrderId <String>]: Order Id of the reservation
3233 [SubscriptionId <String>]: Id of the subscription
34+ . Link
35+ https://learn.microsoft.com/powershell/module/az.reservations/invoke-azreservationreturn
3336#>
3437function Invoke-AzReservationReturn {
35- [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101. IReservationOrderResponse ])]
36- [CmdletBinding (PositionalBinding = $false , SupportsShouldProcess , ConfirmImpact = ' Medium' )]
38+ [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse ])]
39+ [CmdletBinding (DefaultParameterSetName = ' PostExpanded ' , PositionalBinding = $false , SupportsShouldProcess , ConfirmImpact = ' Medium' )]
3740 param (
38- [Parameter (ParameterSetName = ' Post' , Mandatory )]
3941 [Parameter (ParameterSetName = ' PostExpanded' , Mandatory )]
42+ [Parameter (ParameterSetName = ' PostViaJsonFilePath' , Mandatory )]
43+ [Parameter (ParameterSetName = ' PostViaJsonString' , Mandatory )]
4044 [ValidateNotNull ()]
41- [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Body ' )]
45+ [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Path ' )]
4246 [System.String ]
43- # Reservation Order Id.
47+ # Order Id of the reservation
4448 ${ReservationOrderId} ,
45-
49+
50+ [Parameter (ParameterSetName = ' PostViaIdentityExpanded' , Mandatory , ValueFromPipeline )]
51+ [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Path' )]
52+ [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity ]
53+ # Identity Parameter
54+ ${InputObject} ,
55+
4656 [Parameter (ParameterSetName = ' PostExpanded' , Mandatory )]
4757 [Parameter (ParameterSetName = ' PostViaIdentityExpanded' , Mandatory )]
4858 [ValidateNotNull ()]
4959 [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Body' )]
50- [System.String ]
51- # Reservation Id to return.
52- ${ReservationToReturnReservationId} ,
53-
60+ [System.Int32 ]
61+ # Quantity to be returned.
62+ # Must be greater than zero.
63+ ${ReservationToReturnQuantity} ,
64+
5465 [Parameter (ParameterSetName = ' PostExpanded' , Mandatory )]
5566 [Parameter (ParameterSetName = ' PostViaIdentityExpanded' , Mandatory )]
5667 [ValidateNotNull ()]
5768 [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Body' )]
58- [int ]
59- # Quantity to return.
60- ${ReservationToReturnQuantity } ,
69+ [System.String ]
70+ # Fully qualified identifier of the reservation being returned
71+ ${ReservationToReturnReservationId } ,
6172
6273 [Parameter (ParameterSetName = ' PostExpanded' , Mandatory )]
6374 [Parameter (ParameterSetName = ' PostViaIdentityExpanded' , Mandatory )]
6475 [ValidateNotNull ()]
6576 [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Body' )]
6677 [System.String ]
67- # The session id obtained from Invoke-AzReservationCalculateRefund..
68- ${SessionId } ,
78+ # The reason of returning the reservation
79+ ${ReturnReason } ,
6980
7081 [Parameter (ParameterSetName = ' PostExpanded' , Mandatory )]
7182 [Parameter (ParameterSetName = ' PostViaIdentityExpanded' , Mandatory )]
@@ -80,15 +91,27 @@ function Invoke-AzReservationReturn {
8091 [ValidateNotNull ()]
8192 [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Body' )]
8293 [System.String ]
83- # The reason for this reservation return .
84- ${ReturnReason } ,
94+ # The session id obtained from Invoke-AzReservationCalculateRefund. .
95+ ${SessionId } ,
8596
97+ [Parameter (ParameterSetName = ' PostViaJsonFilePath' , Mandatory )]
98+ [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Body' )]
99+ [System.String ]
100+ # Path of Json file supplied to the Post operation
101+ ${JsonFilePath} ,
102+
103+ [Parameter (ParameterSetName = ' PostViaJsonString' , Mandatory )]
104+ [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Body' )]
105+ [System.String ]
106+ # Json string supplied to the Post operation
107+ ${JsonString} ,
86108 [Parameter (DontShow)]
87109 [Alias (' AzureRMContext' , ' AzureCredential' )]
88110 [ValidateNotNull ()]
89111 [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Azure' )]
90112 [System.Management.Automation.PSObject ]
91- # The credentials, account, tenant, and subscription used for communication with Azure.
113+ # The DefaultProfile parameter is not functional.
114+ # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
92115 ${DefaultProfile} ,
93116
94117 [Parameter (DontShow)]
@@ -128,23 +151,7 @@ function Invoke-AzReservationReturn {
128151 [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Runtime' )]
129152 [System.Management.Automation.SwitchParameter ]
130153 # Use the default credentials for the proxy
131- ${ProxyUseDefaultCredentials} ,
132-
133- [Parameter (ParameterSetName = ' PostViaIdentity' , Mandatory , ValueFromPipeline )]
134- [Parameter (ParameterSetName = ' PostViaIdentityExpanded' , Mandatory , ValueFromPipeline )]
135- [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Path' )]
136- [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity ]
137- # Identity Parameter
138- # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
139- ${InputObject} ,
140-
141- [Parameter (ParameterSetName = ' Post' , Mandatory )]
142- [Parameter (ParameterSetName = ' PostViaIdentity' , Mandatory )]
143- [ValidateNotNull ()]
144- [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category (' Body' )]
145- [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest ]
146- # The return request body.
147- ${Body}
154+ ${ProxyUseDefaultCredentials}
148155 )
149156
150157 process {
@@ -153,7 +160,8 @@ function Invoke-AzReservationReturn {
153160 $response = Az.Reservations.internal\Invoke-AzReservationReturn @PSBoundParameters
154161
155162 # Remove extra parameters for Get-AzReservationOrder
156- $null = $PSBoundParameters.Remove (' Body' )
163+ $null = $PSBoundParameters.Remove (' JsonString' )
164+ $null = $PSBoundParameters.Remove (' JsonFilePath' )
157165 $null = $PSBoundParameters.Remove (' ReservationToReturnReservationId' )
158166 $null = $PSBoundParameters.Remove (' ReservationToReturnQuantity' )
159167 $null = $PSBoundParameters.Remove (' SessionId' )
0 commit comments