exports/Disable-NmeConsoleConnectRegion.ps1
|
# ---------------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.8, generator: @autorest/powershell@4.0.752) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # ---------------------------------------------------------------------------------- <# .Synopsis Turning off a region frees all licenses used in that region.\n \nThis method can throw exceptions in the following cases:\n The user must approve the Console Connect agreement.\n The user is trying to disable a region that is already disabled.\n There is already a job for enabling or disabling another region that is waiting to execute or is currently executing.\n \nThis method returns a job that performs all work required to disable Console Connect\nfor the specified region.\n \nYou should wait until the job is completed before working with this region.\nYou cannot enable or disable Console Connect for any region while this job is not completed,\nbecause it can cause unexpected issues.\n \nFor example, if you want to disable Console Connect for a specific region,\nbut there is already a job for enabling or disabling Console Connect for this region,\nyou should wait until that job is completed.\n \nAfter the job is completed, you can check the region status by using the GET method. .Description Turning off a region frees all licenses used in that region.\n \nThis method can throw exceptions in the following cases:\n The user must approve the Console Connect agreement.\n The user is trying to disable a region that is already disabled.\n There is already a job for enabling or disabling another region that is waiting to execute or is currently executing.\n \nThis method returns a job that performs all work required to disable Console Connect\nfor the specified region.\n \nYou should wait until the job is completed before working with this region.\nYou cannot enable or disable Console Connect for any region while this job is not completed,\nbecause it can cause unexpected issues.\n \nFor example, if you want to disable Console Connect for a specific region,\nbut there is already a job for enabling or disabling Console Connect for this region,\nyou should wait until that job is completed.\n \nAfter the job is completed, you can check the region status by using the GET method. #> function Disable-NmeConsoleConnectRegion { [OutputType([NmePowershell.Models.IResponseWithJob])] [CmdletBinding(DefaultParameterSetName='Disable', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] [NmePowershell.PSArgumentCompleterAttribute("US", "EU", "CA", "AU")] [NmePowershell.Category('Path')] [System.String] # . ${Region}, [Parameter(DontShow)] [NmePowershell.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [NmePowershell.Category('Runtime')] [NmePowershell.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [NmePowershell.Category('Runtime')] [NmePowershell.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [NmePowershell.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [NmePowershell.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [NmePowershell.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName $testPlayback = $false $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('NmePowershell.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Disable = 'NerdioManagerPowerShell.private\Disable-NmeConsoleConnectRegion_Disable'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [NmePowershell.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [NmePowershell.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) if ($wrappedCmd -eq $null) { $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { throw } } process { try { $steppablePipeline.Process($_) } catch { throw } } end { try { $steppablePipeline.End() } catch { throw } } } |