@@ -27,7 +27,7 @@ Get-AzProviderHubDefaultRollout -ProviderNamespace "Microsoft.Contoso" -RolloutN
2727. Inputs
2828Microsoft.Azure.PowerShell.Cmdlets.ProviderHub.Models.IProviderHubIdentity
2929. Outputs
30- Microsoft.Azure.PowerShell.Cmdlets.ProviderHub.Models.Api20201120. IDefaultRollout
30+ Microsoft.Azure.PowerShell.Cmdlets.ProviderHub.Models.IDefaultRollout
3131. Notes
3232COMPLEX PARAMETER PROPERTIES
3333
@@ -44,11 +44,23 @@ INPUTOBJECT <IProviderHubIdentity>: Identity Parameter
4444 [RolloutName <String>]: The rollout name.
4545 [Sku <String>]: The SKU.
4646 [SubscriptionId <String>]: The ID of the target subscription.
47+
48+ PROVIDERREGISTRATIONINPUTOBJECT <IProviderHubIdentity>: Identity Parameter
49+ [Id <String>]: Resource identity path
50+ [NestedResourceTypeFirst <String>]: The first child resource type.
51+ [NestedResourceTypeSecond <String>]: The second child resource type.
52+ [NestedResourceTypeThird <String>]: The third child resource type.
53+ [NotificationRegistrationName <String>]: The notification registration.
54+ [ProviderNamespace <String>]: The name of the resource provider hosted within ProviderHub.
55+ [ResourceType <String>]: The resource type.
56+ [RolloutName <String>]: The rollout name.
57+ [Sku <String>]: The SKU.
58+ [SubscriptionId <String>]: The ID of the target subscription.
4759. Link
4860https://learn.microsoft.com/powershell/module/az.providerhub/get-azproviderhubdefaultrollout
4961#>
5062function Get-AzProviderHubDefaultRollout {
51- [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.ProviderHub.Models.Api20201120. IDefaultRollout ])]
63+ [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.ProviderHub.Models.IDefaultRollout ])]
5264[CmdletBinding (DefaultParameterSetName = ' List' , PositionalBinding = $false )]
5365param (
5466 [Parameter (ParameterSetName = ' Get' , Mandatory )]
5971 ${ProviderNamespace} ,
6072
6173 [Parameter (ParameterSetName = ' Get' , Mandatory )]
74+ [Parameter (ParameterSetName = ' GetViaIdentityProviderRegistration' , Mandatory )]
6275 [Microsoft.Azure.PowerShell.Cmdlets.ProviderHub.Category (' Path' )]
6376 [System.String ]
6477 # The rollout name.
@@ -76,9 +89,14 @@ param(
7689 [Microsoft.Azure.PowerShell.Cmdlets.ProviderHub.Category (' Path' )]
7790 [Microsoft.Azure.PowerShell.Cmdlets.ProviderHub.Models.IProviderHubIdentity ]
7891 # Identity Parameter
79- # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
8092 ${InputObject} ,
8193
94+ [Parameter (ParameterSetName = ' GetViaIdentityProviderRegistration' , Mandatory , ValueFromPipeline )]
95+ [Microsoft.Azure.PowerShell.Cmdlets.ProviderHub.Category (' Path' )]
96+ [Microsoft.Azure.PowerShell.Cmdlets.ProviderHub.Models.IProviderHubIdentity ]
97+ # Identity Parameter
98+ ${ProviderRegistrationInputObject} ,
99+
82100 [Parameter ()]
83101 [Alias (' AzureRMContext' , ' AzureCredential' )]
84102 [ValidateNotNull ()]
@@ -135,6 +153,15 @@ begin {
135153 $PSBoundParameters [' OutBuffer' ] = 1
136154 }
137155 $parameterSet = $PSCmdlet.ParameterSetName
156+
157+ $testPlayback = $false
158+ $PSBoundParameters [' HttpPipelinePrepend' ] | Foreach-Object { if ($_ ) { $testPlayback = $testPlayback -or (' Microsoft.Azure.PowerShell.Cmdlets.ProviderHub.Runtime.PipelineMock' -eq $_.Target.GetType ().FullName -and ' Playback' -eq $_.Target.Mode ) } }
159+
160+ $context = Get-AzContext
161+ if (-not $context -and -not $testPlayback ) {
162+ Write-Error " No Azure login detected. Please run 'Connect-AzAccount' to log in."
163+ exit
164+ }
138165
139166 if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PowerShellVersion) {
140167 [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PowerShellVersion = $PSVersionTable.PSVersion.ToString ()
@@ -156,11 +183,10 @@ begin {
156183 $mapping = @ {
157184 Get = ' Az.ProviderHub.private\Get-AzProviderHubDefaultRollout_Get' ;
158185 GetViaIdentity = ' Az.ProviderHub.private\Get-AzProviderHubDefaultRollout_GetViaIdentity' ;
186+ GetViaIdentityProviderRegistration = ' Az.ProviderHub.private\Get-AzProviderHubDefaultRollout_GetViaIdentityProviderRegistration' ;
159187 List = ' Az.ProviderHub.private\Get-AzProviderHubDefaultRollout_List' ;
160188 }
161- if ((' Get' , ' List' ) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey (' SubscriptionId' )) {
162- $testPlayback = $false
163- $PSBoundParameters [' HttpPipelinePrepend' ] | Foreach-Object { if ($_ ) { $testPlayback = $testPlayback -or (' Microsoft.Azure.PowerShell.Cmdlets.ProviderHub.Runtime.PipelineMock' -eq $_.Target.GetType ().FullName -and ' Playback' -eq $_.Target.Mode ) } }
189+ if ((' Get' , ' List' ) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey (' SubscriptionId' ) ) {
164190 if ($testPlayback ) {
165191 $PSBoundParameters [' SubscriptionId' ] = . (Join-Path $PSScriptRoot ' ..' ' utils' ' Get-SubscriptionIdTestSafe.ps1' )
166192 } else {
@@ -174,6 +200,9 @@ begin {
174200 [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name )
175201 }
176202 $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand (($mapping [$parameterSet ]), [System.Management.Automation.CommandTypes ]::Cmdlet)
203+ if ($wrappedCmd -eq $null ) {
204+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand (($mapping [$parameterSet ]), [System.Management.Automation.CommandTypes ]::Function)
205+ }
177206 $scriptCmd = {& $wrappedCmd @PSBoundParameters }
178207 $steppablePipeline = $scriptCmd.GetSteppablePipeline ($MyInvocation.CommandOrigin )
179208 $steppablePipeline.Begin ($PSCmdlet )
0 commit comments