1616
1717<#
1818. Synopsis
19- Create Organization resource
19+ create Organization resource
2020. Description
21- Create Organization resource
21+ create Organization resource
2222. Example
2323New-AzConfluentOrganization -ResourceGroupName azure-rg-test -Name confluentorg-02-pwsh -Location eastus -OfferDetailId "confluent-cloud-azure-prod" -OfferDetailPlanId "confluent-cloud-azure-payg-prod" -OfferDetailPlanName "Confluent Cloud - Pay as you Go" -OfferDetailPublisherId "confluentinc" -OfferDetailTermUnit "P1M" -UserDetailEmailAddress "[email protected] " 2424
2525. Outputs
26- Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301. IOrganizationResource
26+ Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource
2727. Link
2828https://learn.microsoft.com/powershell/module/az.confluent/new-azconfluentorganization
2929#>
3030function New-AzConfluentOrganization {
31- [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301. IOrganizationResource ])]
31+ [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResource ])]
3232[CmdletBinding (DefaultParameterSetName = ' CreateExpanded' , PositionalBinding = $false , SupportsShouldProcess , ConfirmImpact = ' Medium' )]
3333param (
3434 [Parameter (Mandatory )]
@@ -51,67 +51,79 @@ param(
5151 # Microsoft Azure subscription id
5252 ${SubscriptionId} ,
5353
54- [Parameter ()]
54+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
5555 [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category (' Body' )]
5656 [System.String ]
5757 # Location of Organization resource
5858 ${Location} ,
5959
60- [Parameter ()]
60+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
6161 [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category (' Body' )]
6262 [System.String ]
6363 # Offer Id
6464 ${OfferDetailId} ,
6565
66- [Parameter ()]
66+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
6767 [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category (' Body' )]
6868 [System.String ]
6969 # Offer Plan Id
7070 ${OfferDetailPlanId} ,
7171
72- [Parameter ()]
72+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
7373 [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category (' Body' )]
7474 [System.String ]
7575 # Offer Plan Name
7676 ${OfferDetailPlanName} ,
7777
78- [Parameter ()]
78+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
7979 [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category (' Body' )]
8080 [System.String ]
8181 # Publisher Id
8282 ${OfferDetailPublisherId} ,
8383
84- [Parameter ()]
84+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
8585 [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category (' Body' )]
8686 [System.String ]
8787 # Offer Plan Term unit
8888 ${OfferDetailTermUnit} ,
8989
90- [Parameter ()]
90+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
9191 [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category (' Body' )]
92- [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info (PossibleTypes= ([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.Api20200301. IOrganizationResourceTags ]))]
92+ [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.Info (PossibleTypes= ([Microsoft.Azure.PowerShell.Cmdlets.Confluent.Models.IOrganizationResourceTags ]))]
9393 [System.Collections.Hashtable ]
9494 # Organization resource tags
9595 ${Tag} ,
9696
97- [Parameter ()]
97+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
9898 [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category (' Body' )]
9999 [System.String ]
100100 # Email address
101101 ${UserDetailEmailAddress} ,
102102
103- [Parameter ()]
103+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
104104 [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category (' Body' )]
105105 [System.String ]
106106 # First name
107107 ${UserDetailFirstName} ,
108108
109- [Parameter ()]
109+ [Parameter (ParameterSetName = ' CreateExpanded ' )]
110110 [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category (' Body' )]
111111 [System.String ]
112112 # Last name
113113 ${UserDetailLastName} ,
114114
115+ [Parameter (ParameterSetName = ' CreateViaJsonFilePath' , Mandatory )]
116+ [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category (' Body' )]
117+ [System.String ]
118+ # Path of Json file supplied to the Create operation
119+ ${JsonFilePath} ,
120+
121+ [Parameter (ParameterSetName = ' CreateViaJsonString' , Mandatory )]
122+ [Microsoft.Azure.PowerShell.Cmdlets.Confluent.Category (' Body' )]
123+ [System.String ]
124+ # Json string supplied to the Create operation
125+ ${JsonString} ,
126+
115127 [Parameter ()]
116128 [Alias (' AzureRMContext' , ' AzureCredential' )]
117129 [ValidateNotNull ()]
@@ -180,6 +192,15 @@ begin {
180192 $PSBoundParameters [' OutBuffer' ] = 1
181193 }
182194 $parameterSet = $PSCmdlet.ParameterSetName
195+
196+ $testPlayback = $false
197+ $PSBoundParameters [' HttpPipelinePrepend' ] | Foreach-Object { if ($_ ) { $testPlayback = $testPlayback -or (' Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType ().FullName -and ' Playback' -eq $_.Target.Mode ) } }
198+
199+ $context = Get-AzContext
200+ if (-not $context -and -not $testPlayback ) {
201+ Write-Error " No Azure login detected. Please run 'Connect-AzAccount' to log in."
202+ exit
203+ }
183204
184205 if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PowerShellVersion) {
185206 [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PowerShellVersion = $PSVersionTable.PSVersion.ToString ()
@@ -200,10 +221,10 @@ begin {
200221
201222 $mapping = @ {
202223 CreateExpanded = ' Az.Confluent.private\New-AzConfluentOrganization_CreateExpanded' ;
224+ CreateViaJsonFilePath = ' Az.Confluent.private\New-AzConfluentOrganization_CreateViaJsonFilePath' ;
225+ CreateViaJsonString = ' Az.Confluent.private\New-AzConfluentOrganization_CreateViaJsonString' ;
203226 }
204- if ((' CreateExpanded' ) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey (' SubscriptionId' )) {
205- $testPlayback = $false
206- $PSBoundParameters [' HttpPipelinePrepend' ] | Foreach-Object { if ($_ ) { $testPlayback = $testPlayback -or (' Microsoft.Azure.PowerShell.Cmdlets.Confluent.Runtime.PipelineMock' -eq $_.Target.GetType ().FullName -and ' Playback' -eq $_.Target.Mode ) } }
227+ if ((' CreateExpanded' , ' CreateViaJsonFilePath' , ' CreateViaJsonString' ) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey (' SubscriptionId' ) ) {
207228 if ($testPlayback ) {
208229 $PSBoundParameters [' SubscriptionId' ] = . (Join-Path $PSScriptRoot ' ..' ' utils' ' Get-SubscriptionIdTestSafe.ps1' )
209230 } else {
@@ -217,6 +238,9 @@ begin {
217238 [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet ]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name )
218239 }
219240 $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand (($mapping [$parameterSet ]), [System.Management.Automation.CommandTypes ]::Cmdlet)
241+ if ($wrappedCmd -eq $null ) {
242+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand (($mapping [$parameterSet ]), [System.Management.Automation.CommandTypes ]::Function)
243+ }
220244 $scriptCmd = {& $wrappedCmd @PSBoundParameters }
221245 $steppablePipeline = $scriptCmd.GetSteppablePipeline ($MyInvocation.CommandOrigin )
222246 $steppablePipeline.Begin ($PSCmdlet )
0 commit comments