You can use Code Capture to record actions taken in the vSphere Client to produce a PowerCLI code output.

Note: Calls made on operations regarding roles, privileges, tags, content libraries, and storage policies are not recorded. Sensitive data such as passwords is not recorded.

Prerequisites

To use Code Capture to record a session, you must first enable Code Capture.

Procedure

  1. From the home sidebar menu, click Developer Center and go to the Code Capture tab.
  2. (Optional) If Code Capture is not enabled, click the toggle to enable Code Capture.
  3. To start a recording, navigate to your desired pane and click the red record button in the top pane. To start recording immediately, click Start Recording.
    While a recording is in progress, the red record button in the top pane blinks.
  4. (Optional) To clear the code captured in a previous session and start a new session, click Clear and Start Another.
  5. To stop a recording, click the red record button in the top pane, or navigate to the Code Capture tab in the Developer Center and click Stop Recording.
    The recorded code appears in the code pane.
  6. (Optional) Click Copy to copy the code or Download to download it as a PowerCLI script.
  7. To clear the current code and start another recording, click Clear and Start Another or navigate to your desired pane and click the red record button in the top pane.

Results

The recorded code appears in the code pane. You can copy the code, download it, or clear the code to start another recording.