Get-LXCOUpdatePolicies
This cmdlet returns a list of update-compliance policies or returns information about a specific update-compliance policy.
Syntax
Get-LXCOUpdatePolicies [-Connection LXCOConnection]
[CommonParameter]
Get-LXCOUpdatePolicies [-Connection LXCOConnection]
-ID String
[-OutFile String]
[CommonParameter]
Parameters
- -Connection LXCOConnection
- Specifies the connection to the Lenovo XClarity Orchestrator server. If no connection is specified, the result from the last Connect-LXCO cmdlet is used.
- -ID String
- Specifies the update compliance policy ID.
- -OutFile String
- If specified, data is saved as a file in JSON format in the specified location.
If a directory is specified (if the string ends with \ or /), the file name is saved as policyName—currentTimestamp.json.. The timestamp format is MMDDYYYY-HHMMss.
If the directory does not exist, it is automatically created.
- 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.XClarityOrchestrator.PowerShell.Data.UpdatePolicyData
If -ID is not specified, this cmdlet returns an array of UpdatePolicyData objects, which contains information about each update-compliance compliance policy.
- Lenovo.XClarityOrchestrator.PowerShell.Data.UpdatePolicyFullData
If -ID is specified and object, which contains detailed information about the update-compliance policy.
- System.String
If -ID and -OutFile are specified, this cmdlet returns a string with fully-qualified path of the file.
- Lenovo.XClarityOrchestrator.PowerShell.Data.RequestStatusMessage
If an error occurred, this cmdlet returns a RequestStatusMessage object that contains information about the reason of the failure.
Examples
The following example returns a list of update-compliance policies.
$cred = Get-Credential
Connect-LXCO -HostUri 192.0.2.0 -Credential $cred -SkipCertificateCheck
$result = Get-LXCOUpdatePolicies $result | Format-List
Disconnect-LXCO
The following example returns a detailed information about a specified update-compliance policy.
$cred = Get-Credential
Connect-LXCO -HostUri 192.0.2.0 -Credential $cred -SkipCertificateCheck
$result = Get-LXCOUpdatePolicies -ID 1636021473564
$result | Format-List
#show all criteria in this update-policy
$result.Rules[0].Criteria |Format-List
Disconnect-LXCO
The following example returns information about an update-compliance policy as a JSON file named Policy_1—20210106–132035.json in the specified location.
$cred = Get-Credential
Connect-LXCO -HostUri 192.0.2.0 -Credential $cred -SkipCertificateCheck
$result = Get-LXCOUpdatePolicies -ID 1636021473564 -OutFile $PSScriptRoot\..\test
$result
Disconnect-LXCO