exports/Set-CVManagedAccount.ps1


# ----------------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/powershell@4.0.708)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# ----------------------------------------------------------------------------------

<#
.Synopsis
Sets or resets the environment variable for the specified Lighthouse Account ID.
.Description
This cmdlet allows you to set the environment variable `lhAccountId` to the provided Lighthouse Account ID.
If the `-Reset` flag is specified, it clears the `lhAccountId` environment variable.
.Example
{{ Add code here }}
.Example
{{ Add code here }}
 
.Outputs
Writes a confirmation message to the console.
.Link
https://learn.microsoft.com/powershell/module/commvaultpowershell/set-cvmanagedaccount
#>

function Set-CVManagedAccount {
[CmdletBinding(DefaultParameterSetName='Set', PositionalBinding=$false)]
param(
    [Parameter(ParameterSetName='Set')]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # The Lighthouse Account ID to set.
    ${lhAccountId},

    [Parameter(ParameterSetName='Reset', Mandatory)]
    [Commvault.Powershell.Category('Body')]
    [System.Management.Automation.SwitchParameter]
    # Clears the Lighthouse Account ID.
    ${Reset}
)

begin {
    try {
        $outBuffer = $null
        if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
            $PSBoundParameters['OutBuffer'] = 1
        }
        $parameterSet = $PSCmdlet.ParameterSetName

        $mapping = @{
            Set = 'CommvaultPowerShell.custom\Set-CVManagedAccount';
            Reset = 'CommvaultPowerShell.custom\Set-CVManagedAccount';
        }
        $cmdInfo = Get-Command -Name $mapping[$parameterSet]
        [Commvault.Powershell.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
        [Commvault.Powershell.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
        $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
        $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
    }
} 
}