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
- Lenovo.XClarityOrchestrator.PowerShell.Data.RequestStatusMessage
This cmdlet returns a RequestStatusMessage object that contains information about the request status (success or failure). If an error occurred, RequestStatusMessage.Messages contains an array of StatusMessage objects that contains detailed information about the policies that failed to be imported.
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
Give documentation feedback