O'Reilly logo

PowerCLI Cookbook by Philip Sellers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Executing native commands inside the guest operating system from PowerCLI

One of the most interesting cmdlets in PowerCLI is the Invoke-VMScript cmdlet. It allows you to execute scripts and commands inside the guest operating system if it is running VMware Tools. There are a lot of exceptions and requirements that need to be met in order for this cmdlet to work. First, forget about commands that require elevated privileges in Windows. If it prompts you with UAC, then it will most likely not work.

There are some prerequisites needed for Invoke-VMScript to work. First, you need to be running a 32-bit PowerCLI window, the VM guest must be running, and it needs to be running VMware Tools. You should be able to connect to port 902 on the ESXi host from ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required