Skip to main content

Get-LXCOUpdatePolicies

This cmdlet returns a list of update-compliance policies or returns information about a specific update-compliance policy.

Note
You cannot pipe objects to this cmdlet.

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 policyNamecurrentTimestamp.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

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