I am trying to use PowerCLI to assign public IP address to a VM in ESXi but I am getting the following error:
PS /home/usr/xxx> Set-WinVMIP <VM-name> 1:1:1:1 255.255.255.0 0.0.0.0
Set-WinVMIP: The term 'Set-WinVMIP' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Can anyone help me where I am going wrong?
I tried looking at other Stackoverflow answers, but I could not find a solution for my issue.
That error happens because "Set-WinVMIP" is not a standard PowerCLI cmdlet and never was. You're not doing anything wrong. You can write a script to change the IP of a VM and call it Set-WinVMIP if you'd like. Here is an example of one way to do it that you can modify as you want.
Copy it to a file called
Set-WinVMIP.ps1Note: VMware Tools does need to be already installed.