Skip to content

Commit 451c7b9

Browse files
[skip ci] Archive cc6890c (Azure#27589)
1 parent cc6890c commit 451c7b9

File tree

238 files changed

+23348
-6822
lines changed

Some content is hidden

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

238 files changed

+23348
-6822
lines changed

generated/MixedReality/MixedReality.Autorest/Az.MixedReality.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<PropertyGroup>
33
<PsModuleName>MixedReality</PsModuleName>
44
<PsRootModuleName>MixedReality</PsRootModuleName>
5+
<PsModuleFolder>MixedReality.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/MixedReality/MixedReality.Autorest/Az.MixedReality.format.ps1xml

+150-162
Large diffs are not rendered by default.

generated/MixedReality/MixedReality.Autorest/Az.MixedReality.psd1

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
DotNetFrameworkVersion = '4.7.2'
1212
RequiredAssemblies = './bin/Az.MixedReality.private.dll'
1313
FormatsToProcess = './Az.MixedReality.format.ps1xml'
14-
FunctionsToExport = 'Get-AzMixedRealityObjectAnchorsAccount', 'Get-AzMixedRealityObjectAnchorsAccountKey', 'Get-AzMixedRealityRemoteRenderingAccount', 'Get-AzMixedRealityRemoteRenderingAccountKey', 'Get-AzMixedRealitySpatialAnchorsAccount', 'Get-AzMixedRealitySpatialAnchorsAccountKey', 'New-AzMixedRealityObjectAnchorsAccount', 'New-AzMixedRealityObjectAnchorsAccountKey', 'New-AzMixedRealityRemoteRenderingAccount', 'New-AzMixedRealityRemoteRenderingAccountKey', 'New-AzMixedRealitySpatialAnchorsAccount', 'New-AzMixedRealitySpatialAnchorsAccountKey', 'Remove-AzMixedRealityObjectAnchorsAccount', 'Remove-AzMixedRealityRemoteRenderingAccount', 'Remove-AzMixedRealitySpatialAnchorsAccount', 'Test-AzMixedRealityNameAvailability', 'Update-AzMixedRealityObjectAnchorsAccount', 'Update-AzMixedRealityRemoteRenderingAccount', 'Update-AzMixedRealitySpatialAnchorsAccount', '*'
15-
AliasesToExport = '*'
14+
FunctionsToExport = 'Get-AzMixedRealityObjectAnchorsAccount', 'Get-AzMixedRealityObjectAnchorsAccountKey', 'Get-AzMixedRealityRemoteRenderingAccount', 'Get-AzMixedRealityRemoteRenderingAccountKey', 'Get-AzMixedRealitySpatialAnchorsAccount', 'Get-AzMixedRealitySpatialAnchorsAccountKey', 'New-AzMixedRealityObjectAnchorsAccount', 'New-AzMixedRealityObjectAnchorsAccountKey', 'New-AzMixedRealityRemoteRenderingAccount', 'New-AzMixedRealityRemoteRenderingAccountKey', 'New-AzMixedRealitySpatialAnchorsAccount', 'New-AzMixedRealitySpatialAnchorsAccountKey', 'Remove-AzMixedRealityObjectAnchorsAccount', 'Remove-AzMixedRealityRemoteRenderingAccount', 'Remove-AzMixedRealitySpatialAnchorsAccount', 'Test-AzMixedRealityNameAvailability', 'Update-AzMixedRealityObjectAnchorsAccount', 'Update-AzMixedRealityRemoteRenderingAccount', 'Update-AzMixedRealitySpatialAnchorsAccount'
1615
PrivateData = @{
1716
PSData = @{
1817
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'MixedReality'
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
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 - MixedReality")]
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)]
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 - MixedReality")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.2.2")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("0.2.2")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]
2327

24-
[assembly: ComVisible(false)]
25-
[assembly: CLSCompliant(false)]
26-
[assembly: Guid("de62ed38-b3da-4585-8a83-baa3c040a5ab")]
27-
[assembly: AssemblyVersion("0.2.2")]
28-
[assembly: AssemblyFileVersion("0.2.2")]

generated/MixedReality/MixedReality.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/MixedReality/MixedReality.Autorest/exports/Get-AzMixedRealityObjectAnchorsAccount.ps1

+15-6
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Get-AzMixedRealityObjectAnchorsAccount -Name azpstestanchorsaccount-object -Reso
2929
.Inputs
3030
Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.IMixedRealityIdentity
3131
.Outputs
32-
Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.Api20210301Preview.IObjectAnchorsAccount
32+
Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.IObjectAnchorsAccount
3333
.Notes
3434
COMPLEX PARAMETER PROPERTIES
3535
@@ -45,7 +45,7 @@ INPUTOBJECT <IMixedRealityIdentity>: Identity Parameter
4545
https://learn.microsoft.com/powershell/module/az.mixedreality/get-azmixedrealityobjectanchorsaccount
4646
#>
4747
function Get-AzMixedRealityObjectAnchorsAccount {
48-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.Api20210301Preview.IObjectAnchorsAccount])]
48+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.IObjectAnchorsAccount])]
4949
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
5050
param(
5151
[Parameter(ParameterSetName='Get', Mandatory)]
@@ -76,7 +76,6 @@ param(
7676
[Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Category('Path')]
7777
[Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.IMixedRealityIdentity]
7878
# Identity Parameter
79-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
8079
${InputObject},
8180

8281
[Parameter()]
@@ -135,6 +134,15 @@ begin {
135134
$PSBoundParameters['OutBuffer'] = 1
136135
}
137136
$parameterSet = $PSCmdlet.ParameterSetName
137+
138+
$testPlayback = $false
139+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
140+
141+
$context = Get-AzContext
142+
if (-not $context -and -not $testPlayback) {
143+
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
144+
exit
145+
}
138146

139147
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
140148
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -159,9 +167,7 @@ begin {
159167
List = 'Az.MixedReality.private\Get-AzMixedRealityObjectAnchorsAccount_List';
160168
List1 = 'Az.MixedReality.private\Get-AzMixedRealityObjectAnchorsAccount_List1';
161169
}
162-
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
163-
$testPlayback = $false
164-
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
170+
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
165171
if ($testPlayback) {
166172
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
167173
} else {
@@ -175,6 +181,9 @@ begin {
175181
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
176182
}
177183
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
184+
if ($wrappedCmd -eq $null) {
185+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
186+
}
178187
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
179188
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
180189
$steppablePipeline.Begin($PSCmdlet)

generated/MixedReality/MixedReality.Autorest/exports/Get-AzMixedRealityObjectAnchorsAccountKey.ps1

+15-5
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ List Both of the 2 Keys of an object anchors Account
2323
Get-AzMixedRealityObjectAnchorsAccountKey -AccountName azpstestanchorsaccount-object -ResourceGroupName azps_test_group
2424
2525
.Outputs
26-
Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.Api20210301Preview.IAccountKeys
26+
Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.IAccountKeys
2727
.Link
2828
https://learn.microsoft.com/powershell/module/az.mixedreality/get-azmixedrealityobjectanchorsaccountkey
2929
#>
3030
function Get-AzMixedRealityObjectAnchorsAccountKey {
31-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.Api20210301Preview.IAccountKeys])]
31+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.IAccountKeys])]
3232
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
3333
param(
3434
[Parameter(Mandatory)]
@@ -108,6 +108,15 @@ begin {
108108
$PSBoundParameters['OutBuffer'] = 1
109109
}
110110
$parameterSet = $PSCmdlet.ParameterSetName
111+
112+
$testPlayback = $false
113+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
114+
115+
$context = Get-AzContext
116+
if (-not $context -and -not $testPlayback) {
117+
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
118+
exit
119+
}
111120

112121
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
113122
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -129,9 +138,7 @@ begin {
129138
$mapping = @{
130139
List = 'Az.MixedReality.private\Get-AzMixedRealityObjectAnchorsAccountKey_List';
131140
}
132-
if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
133-
$testPlayback = $false
134-
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
141+
if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
135142
if ($testPlayback) {
136143
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
137144
} else {
@@ -145,6 +152,9 @@ begin {
145152
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
146153
}
147154
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
155+
if ($wrappedCmd -eq $null) {
156+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
157+
}
148158
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
149159
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
150160
$steppablePipeline.Begin($PSCmdlet)

generated/MixedReality/MixedReality.Autorest/exports/Get-AzMixedRealityRemoteRenderingAccount.ps1

+15-6
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Get-AzMixedRealityRemoteRenderingAccount -ResourceGroupName azps_test_group -Nam
2929
.Inputs
3030
Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.IMixedRealityIdentity
3131
.Outputs
32-
Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.Api20210301Preview.IRemoteRenderingAccount
32+
Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.IRemoteRenderingAccount
3333
.Notes
3434
COMPLEX PARAMETER PROPERTIES
3535
@@ -45,7 +45,7 @@ INPUTOBJECT <IMixedRealityIdentity>: Identity Parameter
4545
https://learn.microsoft.com/powershell/module/az.mixedreality/get-azmixedrealityremoterenderingaccount
4646
#>
4747
function Get-AzMixedRealityRemoteRenderingAccount {
48-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.Api20210301Preview.IRemoteRenderingAccount])]
48+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.IRemoteRenderingAccount])]
4949
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
5050
param(
5151
[Parameter(ParameterSetName='Get', Mandatory)]
@@ -76,7 +76,6 @@ param(
7676
[Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Category('Path')]
7777
[Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.IMixedRealityIdentity]
7878
# Identity Parameter
79-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
8079
${InputObject},
8180

8281
[Parameter()]
@@ -135,6 +134,15 @@ begin {
135134
$PSBoundParameters['OutBuffer'] = 1
136135
}
137136
$parameterSet = $PSCmdlet.ParameterSetName
137+
138+
$testPlayback = $false
139+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
140+
141+
$context = Get-AzContext
142+
if (-not $context -and -not $testPlayback) {
143+
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
144+
exit
145+
}
138146

139147
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
140148
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -159,9 +167,7 @@ begin {
159167
List = 'Az.MixedReality.private\Get-AzMixedRealityRemoteRenderingAccount_List';
160168
List1 = 'Az.MixedReality.private\Get-AzMixedRealityRemoteRenderingAccount_List1';
161169
}
162-
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
163-
$testPlayback = $false
164-
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
170+
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
165171
if ($testPlayback) {
166172
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
167173
} else {
@@ -175,6 +181,9 @@ begin {
175181
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
176182
}
177183
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
184+
if ($wrappedCmd -eq $null) {
185+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
186+
}
178187
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
179188
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
180189
$steppablePipeline.Begin($PSCmdlet)

generated/MixedReality/MixedReality.Autorest/exports/Get-AzMixedRealityRemoteRenderingAccountKey.ps1

+15-5
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ List Both of the 2 Keys of a Remote Rendering Account
2323
Get-AzMixedRealityRemoteRenderingAccountKey -AccountName azpstestrenderingaccount -ResourceGroupName azps_test_group
2424
2525
.Outputs
26-
Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.Api20210301Preview.IAccountKeys
26+
Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.IAccountKeys
2727
.Link
2828
https://learn.microsoft.com/powershell/module/az.mixedreality/get-azmixedrealityremoterenderingaccountkey
2929
#>
3030
function Get-AzMixedRealityRemoteRenderingAccountKey {
31-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.Api20210301Preview.IAccountKeys])]
31+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Models.IAccountKeys])]
3232
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
3333
param(
3434
[Parameter(Mandatory)]
@@ -108,6 +108,15 @@ begin {
108108
$PSBoundParameters['OutBuffer'] = 1
109109
}
110110
$parameterSet = $PSCmdlet.ParameterSetName
111+
112+
$testPlayback = $false
113+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
114+
115+
$context = Get-AzContext
116+
if (-not $context -and -not $testPlayback) {
117+
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
118+
exit
119+
}
111120

112121
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
113122
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -129,9 +138,7 @@ begin {
129138
$mapping = @{
130139
List = 'Az.MixedReality.private\Get-AzMixedRealityRemoteRenderingAccountKey_List';
131140
}
132-
if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
133-
$testPlayback = $false
134-
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MixedReality.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
141+
if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
135142
if ($testPlayback) {
136143
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
137144
} else {
@@ -145,6 +152,9 @@ begin {
145152
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
146153
}
147154
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
155+
if ($wrappedCmd -eq $null) {
156+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
157+
}
148158
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
149159
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
150160
$steppablePipeline.Begin($PSCmdlet)

0 commit comments

Comments
 (0)