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
- From the home sidebar menu, click Developer Center and go to the Code Capture tab.
- (Optional) If Code Capture is not enabled, click the toggle to enable Code Capture.
- 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.
- (Optional) To clear the code captured in a previous session and start a new session, click Clear and Start Another.
- 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.
- (Optional) Click Copy to copy the code or Download to download it as a PowerCLI script.
- 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.