Scan a Virtual Machine

You can scan a virtual machine against the baselines attached to it or inherited by its parent object.

Prerequisites

Verify that you are connected to a vCenter Server system.

Procedure

  1. Initialize scanning on a virtual machine that is named VM against baselines containing virtual machine hardware upgrades and VMware Tools upgrades.
    $task = Test-Compliance -Entity VM -UpdateType VmHardwareUpgrade, VmToolsUpgrade -RunAsync

    The command initializes a task on the server, returns a snapshot object of the initial state of the task, and saves it in the $task variable.

  2. View the initial status of the scanning task.
    $task
    Note: The task object is not updated with the actual state of the task process running on the server. Even after the task is completed, the $task variable value is running. To view the actual status of the tasks running on the server, use the Get-Task cmdlet.
  3. (Optional) Run the Wait-Task cmdlet to monitor the process progress and wait for the task to complete before running other commands.
    Wait-Task -Task $task