exports/New-SysManLogExecutionLogEntry.ps1

<#
.Synopsis
Creates a new execution log entry. Most commonly used by external system to log informatio not related to any\r\nconsumed action. Example: SysManService started, SysManService shutdown etc.
.Description
Creates a new execution log entry. Most commonly used by external system to log informatio not related to any\r\nconsumed action. Example: SysManService started, SysManService shutdown etc.
.Link
https://docs.microsoft.com/en-us/powershell/module/sysman.webapi/new-sysmanlogexecutionlogentry
#>

function New-SysManLogExecutionLogEntry {
[OutputType('SysMan.Powershell.Models.IActionExecution')]
[CmdletBinding(DefaultParameterSetName='Create', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
[SysMan.Powershell.Description('Creates a new execution log entry. Most commonly used by external system to log informatio not related to any\r\nconsumed action. Example: SysManService started, SysManService shutdown etc.')]
param(
    [Parameter(ParameterSetName='Create', ValueFromPipeline, HelpMessage='Creates a new execution log entry. This i soften done by external systems (sources) based on an executed method.')]
    [SysMan.Powershell.Category('Body')]
    [SysMan.Powershell.Models.ICreateExecutionLogEntryCommand]
    ${Cmd},

    [Parameter(ParameterSetName='CreateExpanded', HelpMessage='The action this execution is related to')]
    [SysMan.Powershell.Category('Body')]
    [System.Int64]
    ${ActionId},

    [Parameter(ParameterSetName='CreateExpanded', Mandatory, HelpMessage='The method that was used, example: Application installation')]
    [SysMan.Powershell.Category('Body')]
    [System.String]
    ${Method},

    [Parameter(ParameterSetName='CreateExpanded', Mandatory, HelpMessage='The method version, example: 1.0.0.0')]
    [SysMan.Powershell.Category('Body')]
    [System.String]
    ${MethodVersion},

    [Parameter(ParameterSetName='CreateExpanded', Mandatory, HelpMessage='Which source (external system) that performed the method execution')]
    [SysMan.Powershell.Category('Body')]
    [System.String]
    ${Source},

    [Parameter(ParameterSetName='CreateExpanded', HelpMessage='The status the execution resulted in')]
    [SysMan.Powershell.Category('Body')]
    [System.String]
    ${Status},

    [Parameter(ParameterSetName='CreateExpanded', Mandatory, HelpMessage='The text')]
    [SysMan.Powershell.Category('Body')]
    [System.String]
    ${Text},

    [Parameter(DontShow, HelpMessage='Wait for .NET debugger to attach')]
    [SysMan.Powershell.Category('Runtime')]
    [System.Management.Automation.SwitchParameter]
    ${Break},

    [Parameter(DontShow, HelpMessage='SendAsync Pipeline Steps to be appended to the front of the pipeline')]
    [ValidateNotNull()]
    [SysMan.Powershell.Category('Runtime')]
    [SysMan.Powershell.Runtime.SendAsyncStep[]]
    ${HttpPipelineAppend},

    [Parameter(DontShow, HelpMessage='SendAsync Pipeline Steps to be prepended to the front of the pipeline')]
    [ValidateNotNull()]
    [SysMan.Powershell.Category('Runtime')]
    [SysMan.Powershell.Runtime.SendAsyncStep[]]
    ${HttpPipelinePrepend},

    [Parameter(DontShow, HelpMessage='The URI for the proxy server to use')]
    [SysMan.Powershell.Category('Runtime')]
    [System.Uri]
    ${Proxy},

    [Parameter(DontShow, HelpMessage='Credentials for a proxy server to use for the remote call')]
    [ValidateNotNull()]
    [SysMan.Powershell.Category('Runtime')]
    [System.Management.Automation.PSCredential]
    ${ProxyCredential},

    [Parameter(DontShow, HelpMessage='Use the default credentials for the proxy')]
    [SysMan.Powershell.Category('Runtime')]
    [System.Management.Automation.SwitchParameter]
    ${ProxyUseDefaultCredentials}
)

begin {
    try {
        $outBuffer = $null
        if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
            $PSBoundParameters['OutBuffer'] = 1
        }
        $parameterSet = $PsCmdlet.ParameterSetName
        $mapping = @{
            Create = 'SysMan.WebApi.private\New-SysManLogExecutionLogEntry_Create';
            CreateExpanded = 'SysMan.WebApi.private\New-SysManLogExecutionLogEntry_CreateExpanded';
        }
        $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
    }
}
}