@@ -25,7 +25,7 @@ Get-AzElasticBillingInfo -ResourceGroupName elastic-rg-3eytki -MonitorName elast
25
25
. Inputs
26
26
Microsoft.Azure.PowerShell.Cmdlets.Elastic.Models.IElasticIdentity
27
27
. Outputs
28
- Microsoft.Azure.PowerShell.Cmdlets.Elastic.Models.Api20240301. IBillingInfoResponse
28
+ Microsoft.Azure.PowerShell.Cmdlets.Elastic.Models.IBillingInfoResponse
29
29
. Notes
30
30
COMPLEX PARAMETER PROPERTIES
31
31
@@ -42,7 +42,7 @@ INPUTOBJECT <IElasticIdentity>: Identity Parameter
42
42
https://learn.microsoft.com/powershell/module/az.elastic/get-azelasticbillinginfo
43
43
#>
44
44
function Get-AzElasticBillingInfo {
45
- [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.Elastic.Models.Api20240301. IBillingInfoResponse ])]
45
+ [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.Elastic.Models.IBillingInfoResponse ])]
46
46
[CmdletBinding (DefaultParameterSetName = ' Get' , PositionalBinding = $false , SupportsShouldProcess , ConfirmImpact = ' Medium' )]
47
47
param (
48
48
[Parameter (ParameterSetName = ' Get' , Mandatory )]
70
70
[Microsoft.Azure.PowerShell.Cmdlets.Elastic.Category (' Path' )]
71
71
[Microsoft.Azure.PowerShell.Cmdlets.Elastic.Models.IElasticIdentity ]
72
72
# Identity Parameter
73
- # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
74
73
${InputObject} ,
75
74
76
75
[Parameter ()]
@@ -129,6 +128,15 @@ begin {
129
128
$PSBoundParameters [' OutBuffer' ] = 1
130
129
}
131
130
$parameterSet = $PSCmdlet.ParameterSetName
131
+
132
+ $testPlayback = $false
133
+ $PSBoundParameters [' HttpPipelinePrepend' ] | Foreach-Object { if ($_ ) { $testPlayback = $testPlayback -or (' Microsoft.Azure.PowerShell.Cmdlets.Elastic.Runtime.PipelineMock' -eq $_.Target.GetType ().FullName -and ' Playback' -eq $_.Target.Mode ) } }
134
+
135
+ $context = Get-AzContext
136
+ if (-not $context -and -not $testPlayback ) {
137
+ Write-Error " No Azure login detected. Please run 'Connect-AzAccount' to log in."
138
+ exit
139
+ }
132
140
133
141
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PowerShellVersion) {
134
142
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PowerShellVersion = $PSVersionTable.PSVersion.ToString ()
@@ -151,9 +159,7 @@ begin {
151
159
Get = ' Az.Elastic.private\Get-AzElasticBillingInfo_Get' ;
152
160
GetViaIdentity = ' Az.Elastic.private\Get-AzElasticBillingInfo_GetViaIdentity' ;
153
161
}
154
- if ((' Get' ) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey (' SubscriptionId' )) {
155
- $testPlayback = $false
156
- $PSBoundParameters [' HttpPipelinePrepend' ] | Foreach-Object { if ($_ ) { $testPlayback = $testPlayback -or (' Microsoft.Azure.PowerShell.Cmdlets.Elastic.Runtime.PipelineMock' -eq $_.Target.GetType ().FullName -and ' Playback' -eq $_.Target.Mode ) } }
162
+ if ((' Get' ) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey (' SubscriptionId' ) ) {
157
163
if ($testPlayback ) {
158
164
$PSBoundParameters [' SubscriptionId' ] = . (Join-Path $PSScriptRoot ' ..' ' utils' ' Get-SubscriptionIdTestSafe.ps1' )
159
165
} else {
@@ -167,6 +173,9 @@ begin {
167
173
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name )
168
174
}
169
175
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand (($mapping [$parameterSet ]), [System.Management.Automation.CommandTypes ]::Cmdlet)
176
+ if ($wrappedCmd -eq $null ) {
177
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand (($mapping [$parameterSet ]), [System.Management.Automation.CommandTypes ]::Function)
178
+ }
170
179
$scriptCmd = {& $wrappedCmd @PSBoundParameters }
171
180
$steppablePipeline = $scriptCmd.GetSteppablePipeline ($MyInvocation.CommandOrigin )
172
181
$steppablePipeline.Begin ($PSCmdlet )
0 commit comments