@@ -29,7 +29,7 @@ Get-AzQuantumWorkspace -ResourceGroupName azps_test_group_quantum -Name azps-qw
29
29
. Inputs
30
30
Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.IQuantumIdentity
31
31
. Outputs
32
- Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.Api20220110Preview. IQuantumWorkspace
32
+ Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.IQuantumWorkspace
33
33
. Notes
34
34
COMPLEX PARAMETER PROPERTIES
35
35
@@ -45,7 +45,7 @@ INPUTOBJECT <IQuantumIdentity>: Identity Parameter
45
45
https://learn.microsoft.com/powershell/module/az.quantum/get-azquantumworkspace
46
46
#>
47
47
function Get-AzQuantumWorkspace {
48
- [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.Api20220110Preview. IQuantumWorkspace ])]
48
+ [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.IQuantumWorkspace ])]
49
49
[CmdletBinding (DefaultParameterSetName = ' List' , PositionalBinding = $false )]
50
50
param (
51
51
[Parameter (ParameterSetName = ' Get' , Mandatory )]
75
75
[Microsoft.Azure.PowerShell.Cmdlets.Quantum.Category (' Path' )]
76
76
[Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.IQuantumIdentity ]
77
77
# Identity Parameter
78
- # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
79
78
${InputObject} ,
80
79
81
80
[Parameter ()]
@@ -134,6 +133,15 @@ begin {
134
133
$PSBoundParameters [' OutBuffer' ] = 1
135
134
}
136
135
$parameterSet = $PSCmdlet.ParameterSetName
136
+
137
+ $testPlayback = $false
138
+ $PSBoundParameters [' HttpPipelinePrepend' ] | Foreach-Object { if ($_ ) { $testPlayback = $testPlayback -or (' Microsoft.Azure.PowerShell.Cmdlets.Quantum.Runtime.PipelineMock' -eq $_.Target.GetType ().FullName -and ' Playback' -eq $_.Target.Mode ) } }
139
+
140
+ $context = Get-AzContext
141
+ if (-not $context -and -not $testPlayback ) {
142
+ Write-Error " No Azure login detected. Please run 'Connect-AzAccount' to log in."
143
+ exit
144
+ }
137
145
138
146
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PowerShellVersion) {
139
147
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PowerShellVersion = $PSVersionTable.PSVersion.ToString ()
@@ -158,9 +166,7 @@ begin {
158
166
List = ' Az.Quantum.private\Get-AzQuantumWorkspace_List' ;
159
167
List1 = ' Az.Quantum.private\Get-AzQuantumWorkspace_List1' ;
160
168
}
161
- if ((' Get' , ' List' , ' List1' ) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey (' SubscriptionId' )) {
162
- $testPlayback = $false
163
- $PSBoundParameters [' HttpPipelinePrepend' ] | Foreach-Object { if ($_ ) { $testPlayback = $testPlayback -or (' Microsoft.Azure.PowerShell.Cmdlets.Quantum.Runtime.PipelineMock' -eq $_.Target.GetType ().FullName -and ' Playback' -eq $_.Target.Mode ) } }
169
+ if ((' Get' , ' List' , ' List1' ) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey (' SubscriptionId' ) ) {
164
170
if ($testPlayback ) {
165
171
$PSBoundParameters [' SubscriptionId' ] = . (Join-Path $PSScriptRoot ' ..' ' utils' ' Get-SubscriptionIdTestSafe.ps1' )
166
172
} else {
@@ -174,6 +180,9 @@ begin {
174
180
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name )
175
181
}
176
182
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand (($mapping [$parameterSet ]), [System.Management.Automation.CommandTypes ]::Cmdlet)
183
+ if ($wrappedCmd -eq $null ) {
184
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand (($mapping [$parameterSet ]), [System.Management.Automation.CommandTypes ]::Function)
185
+ }
177
186
$scriptCmd = {& $wrappedCmd @PSBoundParameters }
178
187
$steppablePipeline = $scriptCmd.GetSteppablePipeline ($MyInvocation.CommandOrigin )
179
188
$steppablePipeline.Begin ($PSCmdlet )
0 commit comments