Skip to main content

New-LXCOUpdatePolicy

This cmdlet creates an update-compliance policy for a specific platform, with one criterion and saves this as a JSON file. This file can then be updated with other platforms and new criteria.

Note
You cannot pipe objects to this cmdlet.

Syntax

New-LXCOUpdatePolicy  -Name String
-OutFile String
[-Description String]
-ComplianceRule String
-PlatformId String
-ComponentId String
-UpdatePackageId String
[CommonParameter]

Parameters

-Connection LXCAConnection
Specifies the connection to the Lenovo XClarity Orchestrator server. If no connection is specified, the result from the last Connect-LXCO cmdlet is used.
-Name String
Specifies the policy name.
-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.

-Description String
Specifies the policy description.
-ComplianceRule String
Specifies the compliance rule. This can be one of the following values.
  • DoNotFlag. Devices that are out of compliance are not flagged
  • FlagIfNotExactMatch. If the software or firmware level that is installed on a resource is not an exact match with the update-compliance policy, the resource is flagged as non-compliant. For example, if you replace a network adapter in a server, and the firmware on that network adapter is different than the level identified in the update-compliance policy, then the server is flagged as non-compliant.
-PlatformId String
Specifies the ID of the platform (resource type) that is associated with the target component.
-ComponentId String
Specifies the target component ID.
Tip
If the target does not have a component, specify the platform ID.
-UpdatePackageId String
Specifies the target update package ID.
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

  • System.String

    This cmdlet returns a string with fully-qualified path of the file.

Examples

The following example creates an update-compliance policy for Lenovo XClarity Administrator.

$result = New-LXCOUpdatePolicy -Name Policy_1 `
-OutFile String $PSScriptRoot/../lxco-updates/ `
-ComplianceRule FlagIfNotExactMatch `
-PlatformId lxca -ComponentId lxca `
-UpdatePackageId lnvgy_sw_lxca_102-2.7.0_anyos_noarch$result