From a27dccbaa254e5b281cebb4591253bb0671d0f98 Mon Sep 17 00:00:00 2001 From: Bala Ganapathy Date: Wed, 11 Apr 2018 18:59:03 -0700 Subject: [PATCH] Removing shouldprocess for New* --- .../New-AzsComputeQuota.ps1 | 59 ++++---- .../SwaggerPathCommands/New-AzsIpPool.ps1 | 133 +++++++++--------- .../New-AzsNetworkQuota.ps1 | 67 +++++---- .../New-AzsStorageQuota.ps1 | 67 +++++---- .../SwaggerPathCommands/New-AzsOffer.ps1 | 75 +++++----- .../New-AzsOfferDelegation.ps1 | 51 ++++--- .../New-AzsSubscriptionPlan.ps1 | 59 ++++---- .../New-AzsUserSubscription.ps1 | 69 +++++---- .../New-AzsSubscription.ps1 | 61 ++++---- 9 files changed, 307 insertions(+), 334 deletions(-) diff --git a/src/StackAdmin/Azs.Compute.Admin/Module/Azs.Compute.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsComputeQuota.ps1 b/src/StackAdmin/Azs.Compute.Admin/Module/Azs.Compute.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsComputeQuota.ps1 index 1592a30e0cb4..e7ed00c8c87d 100644 --- a/src/StackAdmin/Azs.Compute.Admin/Module/Azs.Compute.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsComputeQuota.ps1 +++ b/src/StackAdmin/Azs.Compute.Admin/Module/Azs.Compute.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsComputeQuota.ps1 @@ -43,7 +43,6 @@ Changes may cause incorrect behavior and will be lost if the code is regenerated #> function New-AzsComputeQuota { [OutputType([Microsoft.AzureStack.Management.Compute.Admin.Models.Quota])] - [CmdletBinding(SupportsShouldProcess = $true)] param( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] @@ -89,45 +88,43 @@ function New-AzsComputeQuota { Process { $ErrorActionPreference = 'Stop' - if ($PSCmdlet.ShouldProcess("$Name" , "Add new compute quota")) { - if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Add new compute quota?", "Adding a new compute quota with name $Name")) { + if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Add new compute quota?", "Adding a new compute quota with name $Name")) { - $NewServiceClient_params = @{ - FullClientTypeName = 'Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient' - } + $NewServiceClient_params = @{ + FullClientTypeName = 'Microsoft.AzureStack.Management.Compute.Admin.ComputeAdminClient' + } - $GlobalParameterHashtable = @{} - $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable + $GlobalParameterHashtable = @{} + $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable - $GlobalParameterHashtable['SubscriptionId'] = $null - if ($PSBoundParameters.ContainsKey('SubscriptionId')) { - $GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId'] - } + $GlobalParameterHashtable['SubscriptionId'] = $null + if ($PSBoundParameters.ContainsKey('SubscriptionId')) { + $GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId'] + } - $ComputeAdminClient = New-ServiceClient @NewServiceClient_params + $ComputeAdminClient = New-ServiceClient @NewServiceClient_params - # Default location if missing - if ([String]::IsNullOrEmpty($Location)) { - $Location = (Get-AzureRmLocation).Location - } + # Default location if missing + if ([String]::IsNullOrEmpty($Location)) { + $Location = (Get-AzureRmLocation).Location + } - # Create object - $flattenedParameters = @('AvailabilitySetCount', 'CoresLimit', 'VmScaleSetCount', 'VirtualMachineCount', 'Location' ) - $utilityCmdParams = @{} - $flattenedParameters | ForEach-Object { - $utilityCmdParams[$_] = Get-Variable -Name $_ -ValueOnly - } - $NewQuota = New-QuotaObject @utilityCmdParams + # Create object + $flattenedParameters = @('AvailabilitySetCount', 'CoresLimit', 'VmScaleSetCount', 'VirtualMachineCount', 'Location' ) + $utilityCmdParams = @{} + $flattenedParameters | ForEach-Object { + $utilityCmdParams[$_] = Get-Variable -Name $_ -ValueOnly + } + $NewQuota = New-QuotaObject @utilityCmdParams - Write-Verbose -Message 'Performing operation CreateOrUpdateWithHttpMessagesAsync on $ComputeAdminClient.' - $TaskResult = $ComputeAdminClient.Quotas.CreateOrUpdateWithHttpMessagesAsync($Location, $Name, $NewQuota) + Write-Verbose -Message 'Performing operation CreateOrUpdateWithHttpMessagesAsync on $ComputeAdminClient.' + $TaskResult = $ComputeAdminClient.Quotas.CreateOrUpdateWithHttpMessagesAsync($Location, $Name, $NewQuota) - if ($TaskResult) { - $GetTaskResult_params = @{ - TaskResult = $TaskResult - } - Get-TaskResult @GetTaskResult_params + if ($TaskResult) { + $GetTaskResult_params = @{ + TaskResult = $TaskResult } + Get-TaskResult @GetTaskResult_params } } } diff --git a/src/StackAdmin/Azs.Fabric.Admin/Module/Azs.Fabric.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsIpPool.ps1 b/src/StackAdmin/Azs.Fabric.Admin/Module/Azs.Fabric.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsIpPool.ps1 index c4de8dd7764e..0a6af47673e5 100644 --- a/src/StackAdmin/Azs.Fabric.Admin/Module/Azs.Fabric.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsIpPool.ps1 +++ b/src/StackAdmin/Azs.Fabric.Admin/Module/Azs.Fabric.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsIpPool.ps1 @@ -43,7 +43,6 @@ Licensed under the MIT License. See License.txt in the project root for license #> function New-AzsIpPool { [OutputType([Microsoft.AzureStack.Management.Fabric.Admin.Models.ProvisioningState])] - [CmdletBinding(SupportsShouldProcess = $true)] param( [Parameter(Mandatory = $false)] [string] @@ -98,84 +97,82 @@ function New-AzsIpPool { $ErrorActionPreference = 'Stop' - if ($PSCmdlet.ShouldProcess("$Name" , "Add IP pool")) { - if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Add IP pool?", "Performing operation add IP pool for $Name")) { + if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Add IP pool?", "Performing operation add IP pool for $Name")) { - $NewServiceClient_params = @{ - FullClientTypeName = 'Microsoft.AzureStack.Management.Fabric.Admin.FabricAdminClient' - } + $NewServiceClient_params = @{ + FullClientTypeName = 'Microsoft.AzureStack.Management.Fabric.Admin.FabricAdminClient' + } - $GlobalParameterHashtable = @{} - $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable + $GlobalParameterHashtable = @{} + $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable - $GlobalParameterHashtable['SubscriptionId'] = $null - if ($PSBoundParameters.ContainsKey('SubscriptionId')) { - $GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId'] - } + $GlobalParameterHashtable['SubscriptionId'] = $null + if ($PSBoundParameters.ContainsKey('SubscriptionId')) { + $GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId'] + } - $FabricAdminClient = New-ServiceClient @NewServiceClient_params + $FabricAdminClient = New-ServiceClient @NewServiceClient_params - if ([String]::IsNullOrEmpty($Location)) { - $Location = (Get-AzureRMLocation).Location - } - if ([String]::IsNullOrEmpty($ResourceGroupName)) { - $ResourceGroupName = "System.$Location" - } + if ([String]::IsNullOrEmpty($Location)) { + $Location = (Get-AzureRMLocation).Location + } + if ([String]::IsNullOrEmpty($ResourceGroupName)) { + $ResourceGroupName = "System.$Location" + } - $flattenedParameters = @('NumberOfIpAddressesInTransition', 'StartIpAddress', 'Tags', 'AddressPrefix', 'NumberOfIpAddresses', 'Location', 'EndIpAddress', 'NumberOfAllocatedIpAddresses') - $utilityCmdParams = @{} - $flattenedParameters | ForEach-Object { - if ($PSBoundParameters.ContainsKey($_)) { - $utilityCmdParams[$_] = $PSBoundParameters[$_] - } + $flattenedParameters = @('NumberOfIpAddressesInTransition', 'StartIpAddress', 'Tags', 'AddressPrefix', 'NumberOfIpAddresses', 'Location', 'EndIpAddress', 'NumberOfAllocatedIpAddresses') + $utilityCmdParams = @{} + $flattenedParameters | ForEach-Object { + if ($PSBoundParameters.ContainsKey($_)) { + $utilityCmdParams[$_] = $PSBoundParameters[$_] } - $Pool = New-IpPoolObject @utilityCmdParams - - Write-Verbose -Message 'Performing operation CreateOrUpdateWithHttpMessagesAsync on $FabricAdminClient.' - $TaskResult = $FabricAdminClient.IpPools.CreateOrUpdateWithHttpMessagesAsync($ResourceGroupName, $Location, $Name, $Pool) - - Write-Verbose -Message "Waiting for the operation to complete." - - $PSSwaggerJobScriptBlock = { - [CmdletBinding()] - param( - [Parameter(Mandatory = $true)] - [System.Threading.Tasks.Task] - $TaskResult, - - [Parameter(Mandatory = $true)] - [string] - $TaskHelperFilePath - ) - if ($TaskResult) { - . $TaskHelperFilePath - $GetTaskResult_params = @{ - TaskResult = $TaskResult - } + } + $Pool = New-IpPoolObject @utilityCmdParams + + Write-Verbose -Message 'Performing operation CreateOrUpdateWithHttpMessagesAsync on $FabricAdminClient.' + $TaskResult = $FabricAdminClient.IpPools.CreateOrUpdateWithHttpMessagesAsync($ResourceGroupName, $Location, $Name, $Pool) + + Write-Verbose -Message "Waiting for the operation to complete." + + $PSSwaggerJobScriptBlock = { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [System.Threading.Tasks.Task] + $TaskResult, + + [Parameter(Mandatory = $true)] + [string] + $TaskHelperFilePath + ) + if ($TaskResult) { + . $TaskHelperFilePath + $GetTaskResult_params = @{ + TaskResult = $TaskResult + } - Get-TaskResult @GetTaskResult_params + Get-TaskResult @GetTaskResult_params - } } + } - $PSCommonParameters = Get-PSCommonParameter -CallerPSBoundParameters $PSBoundParameters - $TaskHelperFilePath = Join-Path -Path $ExecutionContext.SessionState.Module.ModuleBase -ChildPath 'Get-TaskResult.ps1' - if (-not $AsJob.IsPresent) { - Invoke-Command -ScriptBlock $PSSwaggerJobScriptBlock ` - -ArgumentList $TaskResult, $TaskHelperFilePath ` - @PSCommonParameters - } else { - $ScriptBlockParameters = New-Object -TypeName 'System.Collections.Generic.Dictionary[string,object]' - $ScriptBlockParameters['TaskResult'] = $TaskResult - $ScriptBlockParameters['AsJob'] = $true - $ScriptBlockParameters['TaskHelperFilePath'] = $TaskHelperFilePath - $PSCommonParameters.GetEnumerator() | ForEach-Object { $ScriptBlockParameters[$_.Name] = $_.Value } - - Start-PSSwaggerJobHelper -ScriptBlock $PSSwaggerJobScriptBlock ` - -CallerPSBoundParameters $ScriptBlockParameters ` - -CallerPSCmdlet $PSCmdlet ` - @PSCommonParameters - } + $PSCommonParameters = Get-PSCommonParameter -CallerPSBoundParameters $PSBoundParameters + $TaskHelperFilePath = Join-Path -Path $ExecutionContext.SessionState.Module.ModuleBase -ChildPath 'Get-TaskResult.ps1' + if (-not $AsJob.IsPresent) { + Invoke-Command -ScriptBlock $PSSwaggerJobScriptBlock ` + -ArgumentList $TaskResult, $TaskHelperFilePath ` + @PSCommonParameters + } else { + $ScriptBlockParameters = New-Object -TypeName 'System.Collections.Generic.Dictionary[string,object]' + $ScriptBlockParameters['TaskResult'] = $TaskResult + $ScriptBlockParameters['AsJob'] = $true + $ScriptBlockParameters['TaskHelperFilePath'] = $TaskHelperFilePath + $PSCommonParameters.GetEnumerator() | ForEach-Object { $ScriptBlockParameters[$_.Name] = $_.Value } + + Start-PSSwaggerJobHelper -ScriptBlock $PSSwaggerJobScriptBlock ` + -CallerPSBoundParameters $ScriptBlockParameters ` + -CallerPSCmdlet $PSCmdlet ` + @PSCommonParameters } } } diff --git a/src/StackAdmin/Azs.Network.Admin/Module/Azs.Network.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsNetworkQuota.ps1 b/src/StackAdmin/Azs.Network.Admin/Module/Azs.Network.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsNetworkQuota.ps1 index a0dddf800697..ceeb0fd9c904 100644 --- a/src/StackAdmin/Azs.Network.Admin/Module/Azs.Network.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsNetworkQuota.ps1 +++ b/src/StackAdmin/Azs.Network.Admin/Module/Azs.Network.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsNetworkQuota.ps1 @@ -50,7 +50,6 @@ Licensed under the MIT License. See License.txt in the project root for license #> function New-AzsNetworkQuota { [OutputType([Microsoft.AzureStack.Management.Network.Admin.Models.Quota])] - [CmdletBinding(SupportsShouldProcess = $true)] param( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] @@ -114,49 +113,47 @@ function New-AzsNetworkQuota { $ErrorActionPreference = 'Stop' - if ($PSCmdlet.ShouldProcess("$Name" , "Create new network quota")) { - if (($Force.IsPresent -or $PSCmdlet.ShouldContinue("Create new network quota?", "Performing operation create network quota with $Name."))) { + if (($Force.IsPresent -or $PSCmdlet.ShouldContinue("Create new network quota?", "Performing operation create network quota with $Name."))) { - $NewServiceClient_params = @{ - FullClientTypeName = 'Microsoft.AzureStack.Management.Network.Admin.NetworkAdminClient' - } + $NewServiceClient_params = @{ + FullClientTypeName = 'Microsoft.AzureStack.Management.Network.Admin.NetworkAdminClient' + } - $GlobalParameterHashtable = @{} - $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable + $GlobalParameterHashtable = @{} + $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable - $GlobalParameterHashtable['SubscriptionId'] = $null - if ($PSBoundParameters.ContainsKey('SubscriptionId')) { - $GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId'] - } + $GlobalParameterHashtable['SubscriptionId'] = $null + if ($PSBoundParameters.ContainsKey('SubscriptionId')) { + $GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId'] + } - $NetworkAdminClient = New-ServiceClient @NewServiceClient_params + $NetworkAdminClient = New-ServiceClient @NewServiceClient_params - if ([String]::IsNullOrEmpty($Location)) { - $Location = (Get-AzureRMLocation).Location - } + if ([String]::IsNullOrEmpty($Location)) { + $Location = (Get-AzureRMLocation).Location + } - # Create object - $flattenedParameters = @( - 'MaxNicsPerSubscription', 'MaxPublicIpsPerSubscription', - 'MaxVirtualNetworkGatewayConnectionsPerSubscription', 'MaxVnetsPerSubscription', - 'MaxVirtualNetworkGatewaysPerSubscription', 'MaxSecurityGroupsPerSubscription', - 'MaxLoadBalancersPerSubscription', 'MigrationPhase' - ) - $utilityCmdParams = @{} - $flattenedParameters | ForEach-Object { - $utilityCmdParams[$_] = Get-Variable -Name $_ -ValueOnly - } - $Quota = New-QuotaObject @utilityCmdParams + # Create object + $flattenedParameters = @( + 'MaxNicsPerSubscription', 'MaxPublicIpsPerSubscription', + 'MaxVirtualNetworkGatewayConnectionsPerSubscription', 'MaxVnetsPerSubscription', + 'MaxVirtualNetworkGatewaysPerSubscription', 'MaxSecurityGroupsPerSubscription', + 'MaxLoadBalancersPerSubscription', 'MigrationPhase' + ) + $utilityCmdParams = @{} + $flattenedParameters | ForEach-Object { + $utilityCmdParams[$_] = Get-Variable -Name $_ -ValueOnly + } + $Quota = New-QuotaObject @utilityCmdParams - Write-Verbose -Message 'Performing operation CreateOrUpdateWithHttpMessagesAsync on $NetworkAdminClient.' - $TaskResult = $NetworkAdminClient.Quotas.CreateOrUpdateWithHttpMessagesAsync($Location, $Name, $Quota) + Write-Verbose -Message 'Performing operation CreateOrUpdateWithHttpMessagesAsync on $NetworkAdminClient.' + $TaskResult = $NetworkAdminClient.Quotas.CreateOrUpdateWithHttpMessagesAsync($Location, $Name, $Quota) - if ($TaskResult) { - $GetTaskResult_params = @{ - TaskResult = $TaskResult - } - Get-TaskResult @GetTaskResult_params + if ($TaskResult) { + $GetTaskResult_params = @{ + TaskResult = $TaskResult } + Get-TaskResult @GetTaskResult_params } } } diff --git a/src/StackAdmin/Azs.Storage.Admin/Module/Azs.Storage.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsStorageQuota.ps1 b/src/StackAdmin/Azs.Storage.Admin/Module/Azs.Storage.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsStorageQuota.ps1 index 52b20fb8b083..a62a5a9b6ba9 100644 --- a/src/StackAdmin/Azs.Storage.Admin/Module/Azs.Storage.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsStorageQuota.ps1 +++ b/src/StackAdmin/Azs.Storage.Admin/Module/Azs.Storage.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsStorageQuota.ps1 @@ -34,7 +34,6 @@ Licensed under the MIT License. See License.txt in the project root for license #> function New-AzsStorageQuota { [OutputType([Microsoft.AzureStack.Management.Storage.Admin.Models.StorageQuota])] - [CmdletBinding(SupportsShouldProcess = $true)] param( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] @@ -73,51 +72,49 @@ function New-AzsStorageQuota { $ErrorActionPreference = 'Stop' - if ($PSCmdlet.ShouldProcess("$Name" , "Create new storage quota")) { - if (($Force.IsPresent -or $PSCmdlet.ShouldContinue("Create new storage quota?", "Performing operation create storage quota with name $Name."))) { + if (($Force.IsPresent -or $PSCmdlet.ShouldContinue("Create new storage quota?", "Performing operation create storage quota with name $Name."))) { - $NewServiceClient_params = @{ - FullClientTypeName = 'Microsoft.AzureStack.Management.Storage.Admin.StorageAdminClient' - } + $NewServiceClient_params = @{ + FullClientTypeName = 'Microsoft.AzureStack.Management.Storage.Admin.StorageAdminClient' + } - $GlobalParameterHashtable = @{} - $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable + $GlobalParameterHashtable = @{} + $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable - $GlobalParameterHashtable['SubscriptionId'] = $null - if ($PSBoundParameters.ContainsKey('SubscriptionId')) { - $GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId'] - } + $GlobalParameterHashtable['SubscriptionId'] = $null + if ($PSBoundParameters.ContainsKey('SubscriptionId')) { + $GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId'] + } - $StorageAdminClient = New-ServiceClient @NewServiceClient_params + $StorageAdminClient = New-ServiceClient @NewServiceClient_params - $flattenedParameters = @('NumberOfStorageAccounts', 'CapacityInGb') - $utilityCmdParams = @{} - $flattenedParameters | ForEach-Object { - if ($PSBoundParameters.ContainsKey($_)) { - $utilityCmdParams[$_] = $PSBoundParameters[$_] - } + $flattenedParameters = @('NumberOfStorageAccounts', 'CapacityInGb') + $utilityCmdParams = @{} + $flattenedParameters | ForEach-Object { + if ($PSBoundParameters.ContainsKey($_)) { + $utilityCmdParams[$_] = $PSBoundParameters[$_] } + } - $Parameters = New-StorageQuotaObject @utilityCmdParams + $Parameters = New-StorageQuotaObject @utilityCmdParams - if ([String]::IsNullOrEmpty($Location)) { - $Location = (Get-AzureRMLocation).Location - } + if ([String]::IsNullOrEmpty($Location)) { + $Location = (Get-AzureRMLocation).Location + } - if ('Create' -eq $PsCmdlet.ParameterSetName) { - Write-Verbose -Message 'Performing operation CreateOrUpdateWithHttpMessagesAsync on $StorageAdminClient.' - $TaskResult = $StorageAdminClient.StorageQuotas.CreateOrUpdateWithHttpMessagesAsync($Location, $Name, $Parameters) - } else { - Write-Verbose -Message 'Failed to map parameter set to operation method.' - throw 'Module failed to find operation to execute.' - } + if ('Create' -eq $PsCmdlet.ParameterSetName) { + Write-Verbose -Message 'Performing operation CreateOrUpdateWithHttpMessagesAsync on $StorageAdminClient.' + $TaskResult = $StorageAdminClient.StorageQuotas.CreateOrUpdateWithHttpMessagesAsync($Location, $Name, $Parameters) + } else { + Write-Verbose -Message 'Failed to map parameter set to operation method.' + throw 'Module failed to find operation to execute.' + } - if ($TaskResult) { - $GetTaskResult_params = @{ - TaskResult = $TaskResult - } - Get-TaskResult @GetTaskResult_params + if ($TaskResult) { + $GetTaskResult_params = @{ + TaskResult = $TaskResult } + Get-TaskResult @GetTaskResult_params } } } diff --git a/src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsOffer.ps1 b/src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsOffer.ps1 index a8aa57bb5b8c..e6cc526d3c63 100644 --- a/src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsOffer.ps1 +++ b/src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsOffer.ps1 @@ -52,7 +52,6 @@ Licensed under the MIT License. See License.txt in the project root for license #> function New-AzsOffer { [OutputType([Microsoft.AzureStack.Management.Subscriptions.Admin.Models.Offer])] - [CmdletBinding(SupportsShouldProcess = $true)] param( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] @@ -123,58 +122,56 @@ function New-AzsOffer { $ErrorActionPreference = 'Stop' - if ($PSCmdlet.ShouldProcess("$Name" , "Create a offer")) { - if (($Force.IsPresent -or $PSCmdlet.ShouldContinue("Create a offer?", "Performing operation create offer with name $Name."))) { + if (($Force.IsPresent -or $PSCmdlet.ShouldContinue("Create a offer?", "Performing operation create offer with name $Name."))) { - if ($PSBoundParameters.ContainsKey('Location')) { - if ( $MyInvocation.Line -match "\s-ArmLocation\s") { - Write-Warning -Message "The parameter alias ArmLocation will be deprecated in future release. Please use the parameter Location instead" - } + if ($PSBoundParameters.ContainsKey('Location')) { + if ( $MyInvocation.Line -match "\s-ArmLocation\s") { + Write-Warning -Message "The parameter alias ArmLocation will be deprecated in future release. Please use the parameter Location instead" } + } - $NewServiceClient_params = @{ - FullClientTypeName = 'Microsoft.AzureStack.Management.Subscriptions.Admin.SubscriptionsAdminClient' - } + $NewServiceClient_params = @{ + FullClientTypeName = 'Microsoft.AzureStack.Management.Subscriptions.Admin.SubscriptionsAdminClient' + } - $GlobalParameterHashtable = @{} - $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable + $GlobalParameterHashtable = @{} + $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable - $GlobalParameterHashtable['SubscriptionId'] = $null - if ($PSBoundParameters.ContainsKey('SubscriptionId')) { - $GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId'] - } + $GlobalParameterHashtable['SubscriptionId'] = $null + if ($PSBoundParameters.ContainsKey('SubscriptionId')) { + $GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId'] + } - $SubscriptionsAdminClient = New-ServiceClient @NewServiceClient_params + $SubscriptionsAdminClient = New-ServiceClient @NewServiceClient_params - if ([String]::IsNullOrEmpty($Location)) { - $Location = (Get-AzureRMLocation).Location - $PSBoundParameters.Add("Location", $Location) - } + if ([String]::IsNullOrEmpty($Location)) { + $Location = (Get-AzureRMLocation).Location + $PSBoundParameters.Add("Location", $Location) + } - if (-not $PSBoundParameters.ContainsKey('State')) { - $State = "Private" - $PSBoundParameters.Add("State", $State) - } + if (-not $PSBoundParameters.ContainsKey('State')) { + $State = "Private" + $PSBoundParameters.Add("State", $State) + } - $flattenedParameters = @('MaxSubscriptionsPerAccount', 'BasePlanIds', 'DisplayName', 'Name', 'Description', 'ExternalReferenceId', 'State', 'Location', 'SubscriptionCount', 'AddonPlanDefinition') - $utilityCmdParams = @{} - $flattenedParameters | ForEach-Object { - if ($PSBoundParameters.ContainsKey($_)) { - $utilityCmdParams[$_] = $PSBoundParameters[$_] - } + $flattenedParameters = @('MaxSubscriptionsPerAccount', 'BasePlanIds', 'DisplayName', 'Name', 'Description', 'ExternalReferenceId', 'State', 'Location', 'SubscriptionCount', 'AddonPlanDefinition') + $utilityCmdParams = @{} + $flattenedParameters | ForEach-Object { + if ($PSBoundParameters.ContainsKey($_)) { + $utilityCmdParams[$_] = $PSBoundParameters[$_] } + } - $NewOffer = New-OfferObject @utilityCmdParams + $NewOffer = New-OfferObject @utilityCmdParams - Write-Verbose -Message 'Performing operation CreateOrUpdateWithHttpMessagesAsync on $SubscriptionsAdminClient.' - $TaskResult = $SubscriptionsAdminClient.Offers.CreateOrUpdateWithHttpMessagesAsync($ResourceGroupName, $Name, $NewOffer) + Write-Verbose -Message 'Performing operation CreateOrUpdateWithHttpMessagesAsync on $SubscriptionsAdminClient.' + $TaskResult = $SubscriptionsAdminClient.Offers.CreateOrUpdateWithHttpMessagesAsync($ResourceGroupName, $Name, $NewOffer) - if ($TaskResult) { - $GetTaskResult_params = @{ - TaskResult = $TaskResult - } - Get-TaskResult @GetTaskResult_params + if ($TaskResult) { + $GetTaskResult_params = @{ + TaskResult = $TaskResult } + Get-TaskResult @GetTaskResult_params } } } diff --git a/src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsOfferDelegation.ps1 b/src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsOfferDelegation.ps1 index e1fe0dfc3e08..abe3a4441213 100644 --- a/src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsOfferDelegation.ps1 +++ b/src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsOfferDelegation.ps1 @@ -34,7 +34,6 @@ Licensed under the MIT License. See License.txt in the project root for license #> function New-AzsOfferDelegation { [OutputType([Microsoft.AzureStack.Management.Subscriptions.Admin.Models.OfferDelegation])] - [CmdletBinding(SupportsShouldProcess = $true)] param( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] @@ -79,41 +78,39 @@ function New-AzsOfferDelegation { $ErrorActionPreference = 'Stop' - if ($PSCmdlet.ShouldProcess("$Name" , "Create a delegated offer")) { - if (($Force.IsPresent -or $PSCmdlet.ShouldContinue("Create a delegated offer?", "Performing operation create delegated offer with name $Name."))) { + if (($Force.IsPresent -or $PSCmdlet.ShouldContinue("Create a delegated offer?", "Performing operation create delegated offer with name $Name."))) { - $NewServiceClient_params = @{ - FullClientTypeName = 'Microsoft.AzureStack.Management.Subscriptions.Admin.SubscriptionsAdminClient' - } + $NewServiceClient_params = @{ + FullClientTypeName = 'Microsoft.AzureStack.Management.Subscriptions.Admin.SubscriptionsAdminClient' + } - $GlobalParameterHashtable = @{} - $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable + $GlobalParameterHashtable = @{} + $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable - $SubscriptionsAdminClient = New-ServiceClient @NewServiceClient_params + $SubscriptionsAdminClient = New-ServiceClient @NewServiceClient_params - if ([String]::IsNullOrEmpty($Location)) { - $Location = (Get-AzureRMLocation).Location - $PSBoundParameters.Add("Location", $Location) - } + if ([String]::IsNullOrEmpty($Location)) { + $Location = (Get-AzureRMLocation).Location + $PSBoundParameters.Add("Location", $Location) + } - $flattenedParameters = @('SubscriptionId', 'Location') - $utilityCmdParams = @{} - $flattenedParameters | ForEach-Object { - if ($PSBoundParameters.ContainsKey($_)) { - $utilityCmdParams[$_] = $PSBoundParameters[$_] - } + $flattenedParameters = @('SubscriptionId', 'Location') + $utilityCmdParams = @{} + $flattenedParameters | ForEach-Object { + if ($PSBoundParameters.ContainsKey($_)) { + $utilityCmdParams[$_] = $PSBoundParameters[$_] } - $NewOfferDelegation = New-OfferDelegationObject @utilityCmdParams + } + $NewOfferDelegation = New-OfferDelegationObject @utilityCmdParams - Write-Verbose -Message 'Performing operation CreateOrUpdateWithHttpMessagesAsync on $SubscriptionsAdminClient.' - $TaskResult = $SubscriptionsAdminClient.OfferDelegations.CreateOrUpdateWithHttpMessagesAsync($ResourceGroupName, $OfferName, $Name, $NewOfferDelegation) + Write-Verbose -Message 'Performing operation CreateOrUpdateWithHttpMessagesAsync on $SubscriptionsAdminClient.' + $TaskResult = $SubscriptionsAdminClient.OfferDelegations.CreateOrUpdateWithHttpMessagesAsync($ResourceGroupName, $OfferName, $Name, $NewOfferDelegation) - if ($TaskResult) { - $GetTaskResult_params = @{ - TaskResult = $TaskResult - } - Get-TaskResult @GetTaskResult_params + if ($TaskResult) { + $GetTaskResult_params = @{ + TaskResult = $TaskResult } + Get-TaskResult @GetTaskResult_params } } } diff --git a/src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsSubscriptionPlan.ps1 b/src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsSubscriptionPlan.ps1 index 18b0a88d9633..85a1719c9471 100644 --- a/src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsSubscriptionPlan.ps1 +++ b/src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsSubscriptionPlan.ps1 @@ -27,7 +27,6 @@ Licensed under the MIT License. See License.txt in the project root for license #> function New-AzsSubscriptionPlan { [OutputType([Microsoft.AzureStack.Management.Subscriptions.Admin.Models.PlanAcquisition])] - [CmdletBinding(SupportsShouldProcess = $true)] param( [Parameter(Mandatory = $false)] [ValidateNotNull()] @@ -60,47 +59,45 @@ function New-AzsSubscriptionPlan { $ErrorActionPreference = 'Stop' - if ($PSCmdlet.ShouldProcess("$TargetSubscriptionId" , "Register subscription to use plan")) { - if (($Force.IsPresent -or $PSCmdlet.ShouldContinue("Register subscription to use plan?", "Performing operation register subscription to plan for subscription $TargetSubscriptionId."))) { + if (($Force.IsPresent -or $PSCmdlet.ShouldContinue("Register subscription to use plan?", "Performing operation register subscription to plan for subscription $TargetSubscriptionId."))) { - $NewServiceClient_params = @{ - FullClientTypeName = 'Microsoft.AzureStack.Management.Subscriptions.Admin.SubscriptionsAdminClient' - } + $NewServiceClient_params = @{ + FullClientTypeName = 'Microsoft.AzureStack.Management.Subscriptions.Admin.SubscriptionsAdminClient' + } - $GlobalParameterHashtable = @{} - $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable + $GlobalParameterHashtable = @{} + $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable - $GlobalParameterHashtable['SubscriptionId'] = $null - if ($PSBoundParameters.ContainsKey('SubscriptionId')) { - $GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId'] - } + $GlobalParameterHashtable['SubscriptionId'] = $null + if ($PSBoundParameters.ContainsKey('SubscriptionId')) { + $GlobalParameterHashtable['SubscriptionId'] = $PSBoundParameters['SubscriptionId'] + } - $SubscriptionsAdminClient = New-ServiceClient @NewServiceClient_params + $SubscriptionsAdminClient = New-ServiceClient @NewServiceClient_params - if (-not $PSBoundParameters.ContainsKey('AcquisitionId')) { - $AcquisitionId = [Guid]::NewGuid().ToString() - $PSBoundParameters.Add("AcquisitionId", $AcquisitionId) - } + if (-not $PSBoundParameters.ContainsKey('AcquisitionId')) { + $AcquisitionId = [Guid]::NewGuid().ToString() + $PSBoundParameters.Add("AcquisitionId", $AcquisitionId) + } - $flattenedParameters = @('PlanId', 'AcquisitionId') - $utilityCmdParams = @{} - $flattenedParameters | ForEach-Object { - if ($PSBoundParameters.ContainsKey($_)) { - $utilityCmdParams[$_] = $PSBoundParameters[$_] - } + $flattenedParameters = @('PlanId', 'AcquisitionId') + $utilityCmdParams = @{} + $flattenedParameters | ForEach-Object { + if ($PSBoundParameters.ContainsKey($_)) { + $utilityCmdParams[$_] = $PSBoundParameters[$_] } + } - $NewAcquiredPlan = New-PlanAcquisitionPropertiesObject @utilityCmdParams + $NewAcquiredPlan = New-PlanAcquisitionPropertiesObject @utilityCmdParams - Write-Verbose -Message 'Performing operation CreateWithHttpMessagesAsync on $SubscriptionsAdminClient.' - $TaskResult = $SubscriptionsAdminClient.AcquiredPlans.CreateWithHttpMessagesAsync($TargetSubscriptionId.ToString(), $AcquisitionId.ToString(), $NewAcquiredPlan) + Write-Verbose -Message 'Performing operation CreateWithHttpMessagesAsync on $SubscriptionsAdminClient.' + $TaskResult = $SubscriptionsAdminClient.AcquiredPlans.CreateWithHttpMessagesAsync($TargetSubscriptionId.ToString(), $AcquisitionId.ToString(), $NewAcquiredPlan) - if ($TaskResult) { - $GetTaskResult_params = @{ - TaskResult = $TaskResult - } - Get-TaskResult @GetTaskResult_params + if ($TaskResult) { + $GetTaskResult_params = @{ + TaskResult = $TaskResult } + Get-TaskResult @GetTaskResult_params } } } diff --git a/src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsUserSubscription.ps1 b/src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsUserSubscription.ps1 index 081d992dad81..9c683c8eae76 100644 --- a/src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsUserSubscription.ps1 +++ b/src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsUserSubscription.ps1 @@ -52,7 +52,6 @@ Licensed under the MIT License. See License.txt in the project root for license #> function New-AzsUserSubscription { [OutputType([Microsoft.AzureStack.Management.Subscriptions.Admin.Models.Subscription])] - [CmdletBinding(SupportsShouldProcess = $true)] param( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] @@ -110,52 +109,50 @@ function New-AzsUserSubscription { $ErrorActionPreference = 'Stop' - if ($PSCmdlet.ShouldProcess("$Owner" , "Create a subscription")) { - if (($Force.IsPresent -or $PSCmdlet.ShouldContinue("Create a subscription?", "Performing operation create subscriptions with owner $Owner."))) { + if (($Force.IsPresent -or $PSCmdlet.ShouldContinue("Create a subscription?", "Performing operation create subscriptions with owner $Owner."))) { - $NewServiceClient_params = @{ - FullClientTypeName = 'Microsoft.AzureStack.Management.Subscriptions.Admin.SubscriptionsAdminClient' - } + $NewServiceClient_params = @{ + FullClientTypeName = 'Microsoft.AzureStack.Management.Subscriptions.Admin.SubscriptionsAdminClient' + } - $GlobalParameterHashtable = @{} - $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable + $GlobalParameterHashtable = @{} + $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable - $SubscriptionsAdminClient = New-ServiceClient @NewServiceClient_params + $SubscriptionsAdminClient = New-ServiceClient @NewServiceClient_params - if (-not $PSBoundParameters.ContainsKey('RoutingResourceManagerType')) { - $RoutingResourceManagerType = "Default" - $PSBoundParameters.Add("RoutingResourceManagerType", $RoutingResourceManagerType) - } + if (-not $PSBoundParameters.ContainsKey('RoutingResourceManagerType')) { + $RoutingResourceManagerType = "Default" + $PSBoundParameters.Add("RoutingResourceManagerType", $RoutingResourceManagerType) + } - if (-not $PSBoundParameters.ContainsKey('State')) { - $State = "Enabled" - $PSBoundParameters.Add("State", $State) - } + if (-not $PSBoundParameters.ContainsKey('State')) { + $State = "Enabled" + $PSBoundParameters.Add("State", $State) + } - if (-not ($PSBoundParameters.ContainsKey('SubscriptionId'))) { - $SubscriptionId = [Guid]::NewGuid().ToString() - $PSBoundParameters.Add("SubscriptionId", $SubscriptionId) - } + if (-not ($PSBoundParameters.ContainsKey('SubscriptionId'))) { + $SubscriptionId = [Guid]::NewGuid().ToString() + $PSBoundParameters.Add("SubscriptionId", $SubscriptionId) + } - $flattenedParameters = @('TenantId', 'SubscriptionId', 'DisplayName', 'DelegatedProviderSubscriptionId', 'Owner', 'RoutingResourceManagerType', 'ExternalReferenceId', 'State', 'OfferId') - $utilityCmdParams = @{} - $flattenedParameters | ForEach-Object { - if ($PSBoundParameters.ContainsKey($_)) { - $utilityCmdParams[$_] = $PSBoundParameters[$_] - } + $flattenedParameters = @('TenantId', 'SubscriptionId', 'DisplayName', 'DelegatedProviderSubscriptionId', 'Owner', 'RoutingResourceManagerType', 'ExternalReferenceId', 'State', 'OfferId') + $utilityCmdParams = @{} + $flattenedParameters | ForEach-Object { + if ($PSBoundParameters.ContainsKey($_)) { + $utilityCmdParams[$_] = $PSBoundParameters[$_] } - $NewSubscription = New-SubscriptionObject @utilityCmdParams - - Write-Verbose -Message 'Performing operation CreateOrUpdateWithHttpMessagesAsync on $SubscriptionsAdminClient.' - $TaskResult = $SubscriptionsAdminClient.Subscriptions.CreateOrUpdateWithHttpMessagesAsync($SubscriptionId, $NewSubscription) + } + $NewSubscription = New-SubscriptionObject @utilityCmdParams - if ($TaskResult) { - $GetTaskResult_params = @{ - TaskResult = $TaskResult - } + Write-Verbose -Message 'Performing operation CreateOrUpdateWithHttpMessagesAsync on $SubscriptionsAdminClient.' + $TaskResult = $SubscriptionsAdminClient.Subscriptions.CreateOrUpdateWithHttpMessagesAsync($SubscriptionId, $NewSubscription) - Get-TaskResult @GetTaskResult_params + if ($TaskResult) { + $GetTaskResult_params = @{ + TaskResult = $TaskResult } + + Get-TaskResult @GetTaskResult_params } } } diff --git a/src/StackAdmin/Azs.Subscriptions/Module/Azs.Subscriptions/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsSubscription.ps1 b/src/StackAdmin/Azs.Subscriptions/Module/Azs.Subscriptions/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsSubscription.ps1 index 0ba5aeb3fa1e..c709f7ae8ea2 100644 --- a/src/StackAdmin/Azs.Subscriptions/Module/Azs.Subscriptions/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsSubscription.ps1 +++ b/src/StackAdmin/Azs.Subscriptions/Module/Azs.Subscriptions/Generated.PowerShell.Commands/SwaggerPathCommands/New-AzsSubscription.ps1 @@ -45,7 +45,6 @@ Licensed under the MIT License. See License.txt in the project root for license #> function New-AzsSubscription { [OutputType([Microsoft.AzureStack.Management.Subscriptions.Models.Subscription])] - [CmdletBinding(SupportsShouldProcess = $true)] param( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] @@ -100,49 +99,47 @@ function New-AzsSubscription { } # Should process - if ($PSCmdlet.ShouldProcess("$SubscriptionId" , "Create a new subscription")) { - if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Create a new subscription?", "Performing operation create subscription with name $SubscriptionId.")) { + if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Create a new subscription?", "Performing operation create subscription with name $SubscriptionId.")) { - $NewServiceClient_params = @{ - FullClientTypeName = 'Microsoft.AzureStack.Management.Subscriptions.SubscriptionsManagementClient' - } + $NewServiceClient_params = @{ + FullClientTypeName = 'Microsoft.AzureStack.Management.Subscriptions.SubscriptionsManagementClient' + } - $GlobalParameterHashtable = @{} - $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable + $GlobalParameterHashtable = @{} + $NewServiceClient_params['GlobalParameterHashtable'] = $GlobalParameterHashtable - $SubscriptionsManagementClient = New-ServiceClient @NewServiceClient_params + $SubscriptionsManagementClient = New-ServiceClient @NewServiceClient_params - if (-not $PSBoundParameters.ContainsKey('State')) { - $State = "Enabled" - $PSBoundParameters.Add("State", $State) - } + if (-not $PSBoundParameters.ContainsKey('State')) { + $State = "Enabled" + $PSBoundParameters.Add("State", $State) + } - if (-not ($PSBoundParameters.ContainsKey('SubscriptionId'))) { - $SubscriptionId = [Guid]::NewGuid().ToString() - $PSBoundParameters.Add("SubscriptionId", $SubscriptionId) - } + if (-not ($PSBoundParameters.ContainsKey('SubscriptionId'))) { + $SubscriptionId = [Guid]::NewGuid().ToString() + $PSBoundParameters.Add("SubscriptionId", $SubscriptionId) + } - $flattenedParameters = @('OfferId', 'Id', 'SubscriptionId', 'State', 'TenantId', 'DisplayName') - $utilityCmdParams = @{} - $flattenedParameters | ForEach-Object { - if ($PSBoundParameters.ContainsKey($_)) { - $utilityCmdParams[$_] = $PSBoundParameters[$_] - } + $flattenedParameters = @('OfferId', 'Id', 'SubscriptionId', 'State', 'TenantId', 'DisplayName') + $utilityCmdParams = @{} + $flattenedParameters | ForEach-Object { + if ($PSBoundParameters.ContainsKey($_)) { + $utilityCmdParams[$_] = $PSBoundParameters[$_] } - $NewSubscription = New-SubscriptionObject @utilityCmdParams + } + $NewSubscription = New-SubscriptionObject @utilityCmdParams - Write-Verbose -Message 'Performing operation CreateOrUpdateWithHttpMessagesAsync on $SubscriptionsManagementClient.' - $TaskResult = $SubscriptionsManagementClient.Subscriptions.CreateOrUpdateWithHttpMessagesAsync($SubscriptionId, $NewSubscription) + Write-Verbose -Message 'Performing operation CreateOrUpdateWithHttpMessagesAsync on $SubscriptionsManagementClient.' + $TaskResult = $SubscriptionsManagementClient.Subscriptions.CreateOrUpdateWithHttpMessagesAsync($SubscriptionId, $NewSubscription) - if ($TaskResult) { - $GetTaskResult_params = @{ - TaskResult = $TaskResult - } + if ($TaskResult) { + $GetTaskResult_params = @{ + TaskResult = $TaskResult + } - Get-TaskResult @GetTaskResult_params + Get-TaskResult @GetTaskResult_params - } } } }