Install-LXCAUpdateManagementServer
This cmdlet installs a management-server update.
Syntax
Install-LXCAUpdateManagementServer [-Connection LXCAConnection]
-FixId String
[-AsJob]
[-WaitForJob]
[-Schedule ScheduleObject]
[CommonParameter]
Parameters
- -Connection LXCAConnection
- Specifies the connection to the Lenovo XClarity Administrator server. If no connection is specified, the result from the last Connect-LXCA cmdlet is used.
- -FixId String
- Specifies the ID of the management-server update package to be applied. The ID can be retrieved from cmdlet Get-LXCAManagementServerPackage.
- -AsJob
- If specified, the cmdlet runs as background job and returns a Job object immediately.
- -WaitForJob
- When specified with the -AsJob parameter, PowerShell waits for this background job in XClarity Administrator to either start or complete before running the next cmdlet in the script. This can be one of the following values.
ToStart. PowerShell waits until this background job starts in XClarity Administrator, so multiple jobs can run synchronously.
ToEnd. PowerShell waits until this background job completes in XClarity Administrator, so that one only job runs at a time.
If this parameter not specified, this cmdlet does not wait. The next cmdlet in the script runs regardless of whether this background job starts or completes.
If -AsJob is not specified, this parameter is ignored.
- -Schedule ScheduleObject
- When specified, the cmdlet runs based on the specified schedule.
- 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
If you specify the -Asjob parameter, this cmdlet returns a Job object. You can retrieve the UpdateResult object from Job.Output when the job is complete. You can retrieve the SubJob from Job.GetSubJobStatus() to get the status of each update.
If you do not specify the -Asjob parameter, this cmdlet does not return an object.
Examples
- The following example installs an existing management-server update package at a specific time, using a schedule object.
$cred = Get-Credential
Connect-LXCA -Host 192.0.2.0 -Port 443 -Credential $cred
# Only one package can be applied at a time!
$fixId = lnvgy_utl_lxca-core_2.4.0-2019xxxx_anyos_noarch
$schedule = New-LXCAScheduleObj -JobName $name -OccurrenceDate (’2019-05-22 4:35 PM')
Install-LXCAUpdateManagementServer -FixId $fixId -Schedule $schedule
Disconnect-LXCA - The following example installs an existing management-server update package. PowerShell waits until the background job completes before running the next cmdlet.
$cred = Get-Credential
Connect-LXCA -Host 192.0.2.0 -Port 443 -Credential $cred
# Only one package can be applied at a time!
$fixId = lnvgy_utl_lxca-core_2.4.0-2019xxxx_anyos_noarch
Install-LXCAUpdateManagementServer -FixId $fixId -WaitForJob ToEnd
Disconnect-LXCA - The following example imports the management-server update package that is located in the c:\updates folder to the XClarity Administrator server and then applies the updates. The import and installation both run as jobs in the background. PowerShell waits until the import-update job completes before applying the update, and then waits for the apply-update job to start before disconnecting fromXClarity Administrator. Note that the installation-job continues to run in XClarity Administrator after the script disconnects PowerShell from XClarity Administrator.
$cred = Get-Credential
Connect-LXCA -Host 192.0.2.0 -Port 443 -Credential $cred
Import-LXCAUpdatePackage -ApplianceUpdate -Folder c:\updates -AsJob -WaitForJob ToEnd
$fixID = "lnvgy_sw_lxca_thinksystemrepo3-2.4.0_anyos_noarch"
Install-LXCAUpdateManagementServer -FixId $fixID -AsJob -WaitForJob ToStart
Disconnect-LXCA