Skip to content

Commit e0cb744

Browse files
[skip ci] Archive de33153 (Azure#27720)
1 parent ec759e6 commit e0cb744

File tree

224 files changed

+13265
-4235
lines changed

Some content is hidden

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

224 files changed

+13265
-4235
lines changed

generated/Subscription/Subscription.Autorest/Az.Subscription.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<PropertyGroup>
33
<PsModuleName>Subscription</PsModuleName>
44
<PsRootModuleName>Subscription</PsRootModuleName>
5+
<PsModuleFolder>Subscription.Autorest</PsModuleFolder>
56
</PropertyGroup>
67

78
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.autorest.props" />
89
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.Post.props" />
9-
1010
</Project>

generated/Subscription/Subscription.Autorest/Az.Subscription.format.ps1xml

+154-160
Large diffs are not rendered by default.

generated/Subscription/Subscription.Autorest/Az.Subscription.psd1

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
DotNetFrameworkVersion = '4.7.2'
1212
RequiredAssemblies = './bin/Az.Subscription.private.dll'
1313
FormatsToProcess = './Az.Subscription.format.ps1xml'
14-
FunctionsToExport = 'Disable-AzSubscription', 'Enable-AzSubscription', 'Get-AzSubscriptionAcceptOwnershipStatus', 'Get-AzSubscriptionAlias', 'Get-AzSubscriptionPolicy', 'Invoke-AzSubscriptionAcceptOwnership', 'New-AzSubscriptionAlias', 'Remove-AzSubscriptionAlias', 'Rename-AzSubscription', '*'
15-
AliasesToExport = '*'
14+
FunctionsToExport = 'Disable-AzSubscription', 'Enable-AzSubscription', 'Get-AzSubscriptionAcceptOwnershipStatus', 'Get-AzSubscriptionAlias', 'Get-AzSubscriptionPolicy', 'Invoke-AzSubscriptionAcceptOwnership', 'New-AzSubscriptionAlias', 'Remove-AzSubscriptionAlias', 'Rename-AzSubscription'
1615
PrivateData = @{
1716
PSData = @{
1817
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Subscription'
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
// ----------------------------------------------------------------------------------
2-
//
3-
// Copyright Microsoft Corporation
4-
// Licensed under the Apache License, Version 2.0 (the "License");
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0 (the ""License"");
53
// you may not use this file except in compliance with the License.
64
// You may obtain a copy of the License at
75
// http://www.apache.org/licenses/LICENSE-2.0
86
// Unless required by applicable law or agreed to in writing, software
9-
// distributed under the License is distributed on an "AS IS" BASIS,
7+
// distributed under the License is distributed on an ""AS IS"" BASIS,
108
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
119
// See the License for the specific language governing permissions and
1210
// limitations under the License.
13-
// ----------------------------------------------------------------------------------
11+
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
12+
// is regenerated.
1413

1514
using System;
1615
using System.Reflection;
16+
using System.Runtime.CompilerServices;
1717
using System.Runtime.InteropServices;
1818

19-
[assembly: AssemblyTitle("Microsoft Azure Powershell - Subscription")]
20-
[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
21-
[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
22-
[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
23-
24-
[assembly: ComVisible(false)]
25-
[assembly: CLSCompliant(false)]
26-
[assembly: Guid("aa59e99e-9b1f-4511-b391-313e29d8a50a")]
27-
[assembly: AssemblyVersion("0.11.2")]
28-
[assembly: AssemblyFileVersion("0.11.2")]
19+
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
20+
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
21+
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
22+
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Subscription")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.11.2")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("0.11.2")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]

generated/Subscription/Subscription.Autorest/check-dependencies.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
1313
# is regenerated.
1414
# ----------------------------------------------------------------------------------
15-
param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources)
15+
param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources)
1616
$ErrorActionPreference = 'Stop'
1717

18-
if(-not $Isolated) {
18+
if(-not $NotIsolated) {
1919
Write-Host -ForegroundColor Green 'Creating isolated process...'
2020
$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
21-
& "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
21+
& "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
2222
return
2323
}
2424

generated/Subscription/Subscription.Autorest/exports/Disable-AzSubscription.ps1

+14-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Disable-AzSubscription -Id XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
2525
.Inputs
2626
Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.ISubscriptionIdentity
2727
.Outputs
28-
System.String
28+
Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.ICanceledSubscriptionId
2929
.Notes
3030
COMPLEX PARAMETER PROPERTIES
3131
@@ -41,7 +41,7 @@ INPUTOBJECT <ISubscriptionIdentity>: Identity Parameter
4141
https://learn.microsoft.com/powershell/module/az.subscription/disable-azsubscription
4242
#>
4343
function Disable-AzSubscription {
44-
[OutputType([System.String])]
44+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.ICanceledSubscriptionId])]
4545
[CmdletBinding(DefaultParameterSetName='Cancel', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
4646
param(
4747
[Parameter(ParameterSetName='Cancel', Mandatory)]
@@ -55,7 +55,6 @@ param(
5555
[Microsoft.Azure.PowerShell.Cmdlets.Subscription.Category('Path')]
5656
[Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.ISubscriptionIdentity]
5757
# Identity Parameter
58-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
5958
${InputObject},
6059

6160
[Parameter()]
@@ -114,6 +113,15 @@ begin {
114113
$PSBoundParameters['OutBuffer'] = 1
115114
}
116115
$parameterSet = $PSCmdlet.ParameterSetName
116+
117+
$testPlayback = $false
118+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Subscription.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
119+
120+
$context = Get-AzContext
121+
if (-not $context -and -not $testPlayback) {
122+
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
123+
exit
124+
}
117125

118126
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
119127
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -143,6 +151,9 @@ begin {
143151
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
144152
}
145153
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
154+
if ($wrappedCmd -eq $null) {
155+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
156+
}
146157
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
147158
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
148159
$steppablePipeline.Begin($PSCmdlet)

generated/Subscription/Subscription.Autorest/exports/Enable-AzSubscription.ps1

+14-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Enable-AzSubscription -Id XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
2525
.Inputs
2626
Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.ISubscriptionIdentity
2727
.Outputs
28-
System.String
28+
Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.IEnabledSubscriptionId
2929
.Notes
3030
COMPLEX PARAMETER PROPERTIES
3131
@@ -41,7 +41,7 @@ INPUTOBJECT <ISubscriptionIdentity>: Identity Parameter
4141
https://learn.microsoft.com/powershell/module/az.subscription/enable-azsubscription
4242
#>
4343
function Enable-AzSubscription {
44-
[OutputType([System.String])]
44+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.IEnabledSubscriptionId])]
4545
[CmdletBinding(DefaultParameterSetName='Enable', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
4646
param(
4747
[Parameter(ParameterSetName='Enable', Mandatory)]
@@ -55,7 +55,6 @@ param(
5555
[Microsoft.Azure.PowerShell.Cmdlets.Subscription.Category('Path')]
5656
[Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.ISubscriptionIdentity]
5757
# Identity Parameter
58-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
5958
${InputObject},
6059

6160
[Parameter()]
@@ -114,6 +113,15 @@ begin {
114113
$PSBoundParameters['OutBuffer'] = 1
115114
}
116115
$parameterSet = $PSCmdlet.ParameterSetName
116+
117+
$testPlayback = $false
118+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Subscription.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
119+
120+
$context = Get-AzContext
121+
if (-not $context -and -not $testPlayback) {
122+
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
123+
exit
124+
}
117125

118126
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
119127
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -143,6 +151,9 @@ begin {
143151
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
144152
}
145153
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
154+
if ($wrappedCmd -eq $null) {
155+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
156+
}
146157
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
147158
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
148159
$steppablePipeline.Begin($PSCmdlet)

generated/Subscription/Subscription.Autorest/exports/Get-AzSubscriptionAcceptOwnershipStatus.ps1

+15-3
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ Get-AzSubscriptionAcceptOwnershipStatus -SubscriptionId XXXXXXXX-XXXX-XXXX-XXXX-
2525
.Inputs
2626
Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.ISubscriptionIdentity
2727
.Outputs
28-
Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.Api20211001.IAcceptOwnershipStatusResponse
28+
Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.IAcceptOwnershipStatusResponse
2929
.Notes
3030
COMPLEX PARAMETER PROPERTIES
3131
3232
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.
3333
34-
INPUTOBJECT <ISubscriptionIdentity>: Identity Parameter
34+
INPUTOBJECT <ISubscriptionIdentity>: Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
3535
[AliasName <String>]: AliasName is the name for the subscription creation request. Note that this is not the same as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation.
3636
[BillingAccountId <String>]: Billing Account Id.
3737
[Id <String>]: Resource identity path
@@ -41,7 +41,7 @@ INPUTOBJECT <ISubscriptionIdentity>: Identity Parameter
4141
https://learn.microsoft.com/powershell/module/az.subscription/get-azsubscriptionacceptownershipstatus
4242
#>
4343
function Get-AzSubscriptionAcceptOwnershipStatus {
44-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.Api20211001.IAcceptOwnershipStatusResponse])]
44+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.IAcceptOwnershipStatusResponse])]
4545
[CmdletBinding(DefaultParameterSetName='AcceptExpanded', PositionalBinding=$false)]
4646
param(
4747
[Parameter(ParameterSetName='AcceptExpanded', Mandatory)]
@@ -113,6 +113,15 @@ begin {
113113
$PSBoundParameters['OutBuffer'] = 1
114114
}
115115
$parameterSet = $PSCmdlet.ParameterSetName
116+
117+
$testPlayback = $false
118+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Subscription.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
119+
120+
$context = Get-AzContext
121+
if (-not $context -and -not $testPlayback) {
122+
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
123+
exit
124+
}
116125

117126
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
118127
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -142,6 +151,9 @@ begin {
142151
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
143152
}
144153
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
154+
if ($wrappedCmd -eq $null) {
155+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
156+
}
145157
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
146158
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
147159
$steppablePipeline.Begin($PSCmdlet)

generated/Subscription/Subscription.Autorest/exports/Get-AzSubscriptionAlias.ps1

+15-4
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ Get-AzSubscriptionAlias -AliasName test-subscription
2727
.Inputs
2828
Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.ISubscriptionIdentity
2929
.Outputs
30-
Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.Api20211001.ISubscriptionAliasListResult
30+
Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.ISubscriptionAliasListResult
3131
.Outputs
32-
Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.Api20211001.ISubscriptionAliasResponse
32+
Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.ISubscriptionAliasResponse
3333
.Notes
3434
COMPLEX PARAMETER PROPERTIES
3535
@@ -45,7 +45,7 @@ INPUTOBJECT <ISubscriptionIdentity>: Identity Parameter
4545
https://learn.microsoft.com/powershell/module/az.subscription/get-azsubscriptionalias
4646
#>
4747
function Get-AzSubscriptionAlias {
48-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.Api20211001.ISubscriptionAliasResponse], [Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.Api20211001.ISubscriptionAliasListResult])]
48+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.ISubscriptionAliasResponse], [Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.ISubscriptionAliasListResult])]
4949
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
5050
param(
5151
[Parameter(ParameterSetName='Get', Mandatory)]
@@ -59,7 +59,6 @@ param(
5959
[Microsoft.Azure.PowerShell.Cmdlets.Subscription.Category('Path')]
6060
[Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.ISubscriptionIdentity]
6161
# Identity Parameter
62-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
6362
${InputObject},
6463

6564
[Parameter()]
@@ -118,6 +117,15 @@ begin {
118117
$PSBoundParameters['OutBuffer'] = 1
119118
}
120119
$parameterSet = $PSCmdlet.ParameterSetName
120+
121+
$testPlayback = $false
122+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Subscription.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
123+
124+
$context = Get-AzContext
125+
if (-not $context -and -not $testPlayback) {
126+
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
127+
exit
128+
}
121129

122130
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
123131
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -148,6 +156,9 @@ begin {
148156
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
149157
}
150158
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
159+
if ($wrappedCmd -eq $null) {
160+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
161+
}
151162
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
152163
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
153164
$steppablePipeline.Begin($PSCmdlet)

generated/Subscription/Subscription.Autorest/exports/Get-AzSubscriptionPolicy.ps1

+14-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ Get the subscription tenant policy for the user's tenant.
2323
Get-AzSubscriptionPolicy
2424
2525
.Outputs
26-
Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.Api20211001.IGetTenantPolicyResponse
26+
Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.IGetTenantPolicyResponse
2727
.Link
2828
https://learn.microsoft.com/powershell/module/az.subscription/get-azsubscriptionpolicy
2929
#>
3030
function Get-AzSubscriptionPolicy {
31-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.Api20211001.IGetTenantPolicyResponse])]
31+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Subscription.Models.IGetTenantPolicyResponse])]
3232
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
3333
param(
3434
[Parameter()]
@@ -87,6 +87,15 @@ begin {
8787
$PSBoundParameters['OutBuffer'] = 1
8888
}
8989
$parameterSet = $PSCmdlet.ParameterSetName
90+
91+
$testPlayback = $false
92+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Subscription.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
93+
94+
$context = Get-AzContext
95+
if (-not $context -and -not $testPlayback) {
96+
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
97+
exit
98+
}
9099

91100
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
92101
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -115,6 +124,9 @@ begin {
115124
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
116125
}
117126
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
127+
if ($wrappedCmd -eq $null) {
128+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
129+
}
118130
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
119131
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
120132
$steppablePipeline.Begin($PSCmdlet)

0 commit comments

Comments
 (0)