Skip to main content

Import-LXCOUpdatePolicies

This cmdlet imports one or more files that contain update-compliance policy definitions, in JSON format. Each file can contain only a single policy.

Note
You cannot pipe objects to this cmdlet.

Syntax

Import-LXCOUpdatePolicies [-Connection LXCOConnection] 
-InFiles 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.
-InFiles String[]
Specifies a list of update-compliance policy file names, separated by a comma.
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

This example imports an update-compliance policy.

$cred = Get-Credential
Connect-LXCO -HostUri 192.0.2.0 -Credential $cred -SkipCertificateCheck

$result = Import-LXCOUpdatePolicies -InFile Policy_1.json
$result | Format-List

Disconnect-LXCO

This example imports a list of update-compliance policies.

$cred = Get-Credential
Connect-LXCO -HostUri 192.0.2.0 -Credential $cred -SkipCertificateCheck

$files = @(
"$PSScriptRoot/../test/compliance20.json",
"$PSScriptRoot/../test/compliance30.json"
)
$result = Import-LXCOUpdatePolicies -InFile $files
$result | Format-List

Disconnect-LXCO