Skip to content

Commit 1bb88db

Browse files
[skip ci] Archive a1cce68 (#27939)
1 parent 0459946 commit 1bb88db

File tree

284 files changed

+12891
-10238
lines changed

Some content is hidden

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

284 files changed

+12891
-10238
lines changed

generated/Purview/Purview.Autorest/Az.Purview.csproj

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

Lines changed: 118 additions & 142 deletions
Large diffs are not rendered by default.

generated/Purview/Purview.Autorest/Az.Purview.psd1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
DotNetFrameworkVersion = '4.7.2'
1212
RequiredAssemblies = './bin/Az.Purview.private.dll'
1313
FormatsToProcess = './Az.Purview.format.ps1xml'
14-
FunctionsToExport = 'Add-AzPurviewAccountRootCollectionAdmin', 'Get-AzPurviewAccount', 'Get-AzPurviewAccountKey', 'Get-AzPurviewDefaultAccount', 'New-AzPurviewAccount', 'Remove-AzPurviewAccount', 'Remove-AzPurviewDefaultAccount', 'Set-AzPurviewDefaultAccount', 'Test-AzPurviewAccountNameAvailability', 'Update-AzPurviewAccount', '*'
15-
AliasesToExport = '*'
14+
FunctionsToExport = 'Add-AzPurviewAccountRootCollectionAdmin', 'Get-AzPurviewAccount', 'Get-AzPurviewAccountKey', 'Get-AzPurviewDefaultAccount', 'New-AzPurviewAccount', 'Remove-AzPurviewAccount', 'Remove-AzPurviewDefaultAccount', 'Set-AzPurviewDefaultAccount', 'Test-AzPurviewAccountNameAvailability', 'Update-AzPurviewAccount'
1615
PrivateData = @{
1716
PSData = @{
1817
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Purview'
Lines changed: 14 additions & 16 deletions
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 - Purview")]
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("38f45a94-53e4-4ac6-bf85-766a68141e53")]
27-
[assembly: AssemblyVersion("0.2.2")]
28-
[assembly: AssemblyFileVersion("0.2.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 - Purview")]
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)]

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

Lines changed: 3 additions & 3 deletions
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/Purview/Purview.Autorest/exports/Add-AzPurviewAccountRootCollectionAdmin.ps1

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,24 @@ function Add-AzPurviewAccountRootCollectionAdmin {
4949
[CmdletBinding(DefaultParameterSetName='AddExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
5050
param(
5151
[Parameter(ParameterSetName='AddExpanded', Mandatory)]
52+
[Parameter(ParameterSetName='AddViaJsonString', Mandatory)]
53+
[Parameter(ParameterSetName='AddViaJsonFilePath', Mandatory)]
5254
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Path')]
5355
[System.String]
5456
# The name of the account.
5557
${AccountName},
5658

5759
[Parameter(ParameterSetName='AddExpanded', Mandatory)]
60+
[Parameter(ParameterSetName='AddViaJsonString', Mandatory)]
61+
[Parameter(ParameterSetName='AddViaJsonFilePath', Mandatory)]
5862
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Path')]
5963
[System.String]
6064
# The resource group name.
6165
${ResourceGroupName},
6266

6367
[Parameter(ParameterSetName='AddExpanded')]
68+
[Parameter(ParameterSetName='AddViaJsonString')]
69+
[Parameter(ParameterSetName='AddViaJsonFilePath')]
6470
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Path')]
6571
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
6672
[System.String]
@@ -71,21 +77,34 @@ param(
7177
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Path')]
7278
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.IPurviewIdentity]
7379
# Identity Parameter
74-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
7580
${InputObject},
7681

77-
[Parameter(Mandatory)]
82+
[Parameter(ParameterSetName='AddExpanded', Mandatory)]
83+
[Parameter(ParameterSetName='AddViaIdentityExpanded', Mandatory)]
7884
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
7985
[System.String]
8086
# Gets or sets the object identifier of the admin.
8187
${ObjectId},
8288

89+
[Parameter(ParameterSetName='AddViaJsonString', Mandatory)]
90+
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
91+
[System.String]
92+
# Json string supplied to the Add operation
93+
${JsonString},
94+
95+
[Parameter(ParameterSetName='AddViaJsonFilePath', Mandatory)]
96+
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Body')]
97+
[System.String]
98+
# Path of Json file supplied to the Add operation
99+
${JsonFilePath},
100+
83101
[Parameter()]
84102
[Alias('AzureRMContext', 'AzureCredential')]
85103
[ValidateNotNull()]
86104
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Azure')]
87105
[System.Management.Automation.PSObject]
88-
# The credentials, account, tenant, and subscription used for communication with Azure.
106+
# The DefaultProfile parameter is not functional.
107+
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
89108
${DefaultProfile},
90109

91110
[Parameter(DontShow)]
@@ -141,6 +160,15 @@ begin {
141160
$PSBoundParameters['OutBuffer'] = 1
142161
}
143162
$parameterSet = $PSCmdlet.ParameterSetName
163+
164+
$testPlayback = $false
165+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Purview.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
166+
167+
$context = Get-AzContext
168+
if (-not $context -and -not $testPlayback) {
169+
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
170+
exit
171+
}
144172

145173
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
146174
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -161,11 +189,11 @@ begin {
161189

162190
$mapping = @{
163191
AddExpanded = 'Az.Purview.custom\Add-AzPurviewAccountRootCollectionAdmin';
192+
AddViaJsonString = 'Az.Purview.custom\Add-AzPurviewAccountRootCollectionAdmin';
193+
AddViaJsonFilePath = 'Az.Purview.custom\Add-AzPurviewAccountRootCollectionAdmin';
164194
AddViaIdentityExpanded = 'Az.Purview.custom\Add-AzPurviewAccountRootCollectionAdmin';
165195
}
166-
if (('AddExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
167-
$testPlayback = $false
168-
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Purview.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
196+
if (('AddExpanded', 'AddViaJsonString', 'AddViaJsonFilePath') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
169197
if ($testPlayback) {
170198
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
171199
} else {
@@ -179,6 +207,9 @@ begin {
179207
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
180208
}
181209
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
210+
if ($wrappedCmd -eq $null) {
211+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
212+
}
182213
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
183214
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
184215
$steppablePipeline.Begin($PSCmdlet)

generated/Purview/Purview.Autorest/exports/Get-AzPurviewAccount.ps1

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Get-AzADDomainService -InputObject $got
3232
.Inputs
3333
Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.IPurviewIdentity
3434
.Outputs
35-
Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.Api20210701.IAccount
35+
Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.IAccount
3636
.Notes
3737
COMPLEX PARAMETER PROPERTIES
3838
@@ -49,7 +49,7 @@ INPUTOBJECT <IPurviewIdentity>: Identity Parameter
4949
https://learn.microsoft.com/powershell/module/az.purview/get-azpurviewaccount
5050
#>
5151
function Get-AzPurviewAccount {
52-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.Api20210701.IAccount])]
52+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.IAccount])]
5353
[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)]
5454
param(
5555
[Parameter(ParameterSetName='Get', Mandatory)]
@@ -79,7 +79,6 @@ param(
7979
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Path')]
8080
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.IPurviewIdentity]
8181
# Identity Parameter
82-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
8382
${InputObject},
8483

8584
[Parameter(ParameterSetName='List')]
@@ -145,6 +144,15 @@ begin {
145144
$PSBoundParameters['OutBuffer'] = 1
146145
}
147146
$parameterSet = $PSCmdlet.ParameterSetName
147+
148+
$testPlayback = $false
149+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Purview.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
150+
151+
$context = Get-AzContext
152+
if (-not $context -and -not $testPlayback) {
153+
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
154+
exit
155+
}
148156

149157
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
150158
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -169,9 +177,7 @@ begin {
169177
List = 'Az.Purview.private\Get-AzPurviewAccount_List';
170178
List1 = 'Az.Purview.private\Get-AzPurviewAccount_List1';
171179
}
172-
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
173-
$testPlayback = $false
174-
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Purview.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
180+
if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
175181
if ($testPlayback) {
176182
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
177183
} else {
@@ -185,6 +191,9 @@ begin {
185191
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
186192
}
187193
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
194+
if ($wrappedCmd -eq $null) {
195+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
196+
}
188197
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
189198
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
190199
$steppablePipeline.Begin($PSCmdlet)

generated/Purview/Purview.Autorest/exports/Get-AzPurviewAccountKey.ps1

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ List the authorization keys associated with this account.
2323
Get-AzPurviewAccountKey -AccountName test-pa -ResourceGroupName test-rg
2424
2525
.Outputs
26-
Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.Api20210701.IAccessKeys
26+
Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.IAccessKeys
2727
.Link
2828
https://learn.microsoft.com/powershell/module/az.purview/get-azpurviewaccountkey
2929
#>
3030
function Get-AzPurviewAccountKey {
31-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.Api20210701.IAccessKeys])]
31+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.IAccessKeys])]
3232
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
3333
param(
3434
[Parameter(Mandatory)]
@@ -106,6 +106,15 @@ begin {
106106
$PSBoundParameters['OutBuffer'] = 1
107107
}
108108
$parameterSet = $PSCmdlet.ParameterSetName
109+
110+
$testPlayback = $false
111+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Purview.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
112+
113+
$context = Get-AzContext
114+
if (-not $context -and -not $testPlayback) {
115+
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
116+
exit
117+
}
109118

110119
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
111120
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -127,9 +136,7 @@ begin {
127136
$mapping = @{
128137
List = 'Az.Purview.private\Get-AzPurviewAccountKey_List';
129138
}
130-
if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
131-
$testPlayback = $false
132-
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Purview.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
139+
if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) {
133140
if ($testPlayback) {
134141
$PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')
135142
} else {
@@ -143,6 +150,9 @@ begin {
143150
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
144151
}
145152
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
153+
if ($wrappedCmd -eq $null) {
154+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
155+
}
146156
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
147157
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
148158
$steppablePipeline.Begin($PSCmdlet)

generated/Purview/Purview.Autorest/exports/Get-AzPurviewDefaultAccount.ps1

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ Get the default account for the scope.
2323
Get-AzPurviewDefaultAccount -ScopeTenantId xxxxxxxx-38d6-4fb2-bad9-b7b93a3e9c5a -ScopeType Tenant
2424
2525
.Outputs
26-
Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.Api20210701.IDefaultAccountPayload
26+
Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.IDefaultAccountPayload
2727
.Link
2828
https://learn.microsoft.com/powershell/module/az.purview/get-azpurviewdefaultaccount
2929
#>
3030
function Get-AzPurviewDefaultAccount {
31-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.Api20210701.IDefaultAccountPayload])]
31+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Purview.Models.IDefaultAccountPayload])]
3232
[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)]
3333
param(
3434
[Parameter(Mandatory)]
@@ -38,9 +38,9 @@ param(
3838
${ScopeTenantId},
3939

4040
[Parameter(Mandatory)]
41-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Purview.Support.ScopeType])]
41+
[Microsoft.Azure.PowerShell.Cmdlets.Purview.PSArgumentCompleterAttribute("Tenant", "Subscription")]
4242
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Category('Query')]
43-
[Microsoft.Azure.PowerShell.Cmdlets.Purview.Support.ScopeType]
43+
[System.String]
4444
# The scope for the default account.
4545
${ScopeType},
4646

@@ -106,6 +106,15 @@ begin {
106106
$PSBoundParameters['OutBuffer'] = 1
107107
}
108108
$parameterSet = $PSCmdlet.ParameterSetName
109+
110+
$testPlayback = $false
111+
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Purview.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }
112+
113+
$context = Get-AzContext
114+
if (-not $context -and -not $testPlayback) {
115+
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
116+
exit
117+
}
109118

110119
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
111120
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
@@ -134,6 +143,9 @@ begin {
134143
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
135144
}
136145
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
146+
if ($wrappedCmd -eq $null) {
147+
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
148+
}
137149
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
138150
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
139151
$steppablePipeline.Begin($PSCmdlet)

0 commit comments

Comments
 (0)