Get-LXC1Job
This cmdlet returns a list of jobs or details for a specific job.
Note
You cannot pipe objects to this cmdlet.
Syntax
Get-LXC1Job -ID String
[-ChildrenLevels Int32]
[-Connection LXC1Connection]
[CommonParameter]
Get-LXC1Job [-Status String[]]
[-Date String[]]
[-Title String[]]
[-TitleSearchType String]
[-Anywhere String[]]
[-AnywhereSearchType String]
[-Connection LXC1Connection]
[CommonParameter]
Parameters
- -ID String
- Specifies the ID of the job to return.
- -ChildrenLevels Int32
- Levels of subtasks to return. This can be one of the following values.
- -1. All subtasks are returned.
- 0. (default) No subtasks are returned.
- {number}. The specified level of subtasks is returned.
- -Status String[]
- Specifies the job status. All jobs that match any of the specified statuses are returned. This can be one or more of the following values, separated by a comma.
- aborted
- blocked
- cancelling
- cancelled
- cancelledWithErrors
- cancelledWithWarnings
- complete
- completeWithErrors
- completeWithWarnings
- expired
- initializing
- interrupted
- interruptedWithErrors
- interruptedWithWarnings
- investigating
- pending
- resolved
- running
- runningWithErrors
- runningWithWarnings
- skipped
- stopped
- stoppedWithErrors
- stoppedWithWarnings
- unknown
- uploading
- validating
- waiting
- -Date String[]
- Specifies the dates when jobs were started, as range using the following format: <startDate>,<endDate>. All alerts that were started during that range are returned.
The end date is optional. If is not specified, the current date is used by default.
NoteFormat the date according to the current settings of the OS from where the cmdlet is run. - -Title String[]
- Specifies one or more full or partial job titles, separated by a comma. All jobs that match any of the specified patterns based on the operator (-TitleSearchType parameter) are returned.
- -TitleSearchType String
- Specifies the operator to use for patterns in the -Title parameter. This can be one of the following values.
- contains (default)
- notContains
- equals
- notEquals
If -Title is not specified, this parameter is ignored.
- -Anywhere String[]
- Specifies one or more full or partial text found in any job attributes, separated by a comma. All jobs that match any of the specified patterns based on the operator (-AnywhereSearchType parameter) are returned.
- -AnywhereSearchType String
- Specifies the operator to use for patterns in the -Anywhere parameter. This can be one of the following values.
- contains (default)
- notContains
- equals
- notEquals
If -Anywhere is not specified, this parameter is ignored.
- -Connection LXC1Connection
- Specifies the connection to the XClarity One server. If no connection is specified, the result from the last Connect-LXC1 cmdlet is used.
- CommonParameters
- This cmdlet supports the following common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable, -OutBuffer, -PipelineVariable, -OutVariable. For detailed information about each common parameter, see the Microsoft PowerShell Common Parameters webpage.
Results
Lenovo.XC1.PowerShell.Automation.Data.LXC1Response
This cmdlet returns an LXC1Response object that contains data that is returned by the portal as a string in JSON format and as a deserialized PSObject.
Lenovo.XC1.PowerShell.Automation.Data.RequestStatusMessage
If the request fails, an RequestStatusMessage object is returned with failure details.
Examples
The following example returns information about all jobs.
param (
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $ClientID,
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $UserSecret
)
$securePassword = ConvertTo-SecureString $UserSecret -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($ClientID, $securePassword))
$hostOnprem = "192.0.2.0"
$connection = Connect-LXC1 -PortalAddress $hostOnprem `
-Credential $cred `
-PortalType cloud `
-SkipCertificateCheck
$result = Get-LXC1Job
$result|Format-List
The following example returns jobs based on Anywhere, Status and that are newer than specified date.
param (
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $ClientID,
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $UserSecret
)
$securePassword = ConvertTo-SecureString $UserSecret -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($ClientID, $securePassword))
$hostOnprem = "192.0.2.0"
$connection = Connect-LXC1 -PortalAddress $hostOnprem `
-Credential $cred `
-PortalType cloud `
-SkipCertificateCheck
$result = Get-LXC1Job -Anywhere manage `
-AnywhereSearchType notContains `
-Status runnin,runningWithWarnings,runningWithErrors `
-Date '11.1.2025 14:30:00'
$result|Format-List
The following example returns a detailed information about a specific job, with all subtasks.
param (
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $ClientID,
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $UserSecret
)
$securePassword = ConvertTo-SecureString $UserSecret -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($ClientID, $securePassword))
$hostOnprem = "192.0.2.0"
$connection = Connect-LXC1 -PortalAddress $hostOnprem `
-Credential $cred `
-PortalType cloud `
-SkipCertificateCheck
$result = Get-LXC1Job -ID 34183 `
-ChildrenLevels -1
$result
Give documentation feedback