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.ps1
Note: VMware Tools does need to be already installed.
$GC = $Host.UI.PromptForCredential("Please enter credentials", "Enter Guest credentials for VM", "Administrator", "")
Function Read-MyHost {
[cmdletbinding()]
Param(
[Parameter(Position=0,Mandatory,HelpMessage="Enter the message prompt.")]
[ValidateNotNullorEmpty()]
[string]$Message,
[Parameter(Position=1,Mandatory,HelpMessage="Enter key property name or names separated by commas.")]
[System.Management.Automation.Host.FieldDescription []]$Key,
[Parameter(HelpMessage = "Text to display as a title for the prompt.")]
[string]$PromptTitle = "",
[Parameter(HelpMessage = "Convert the result to an object.")]
[switch]$AsObject
)
$response = $host.ui.Prompt($PromptTitle,$Message,$Key)
if ($AsObject) {
#create a custom object
New-Object -TypeName PSObject -Property $response
}
else {
#write the result to the pipeline
$response
}
} #end function
$VMINFO = Read-MyHost "Enter the follwing information for the VM" -Key "VMName","IP","SubnetMask","Gateway","DNS1","DNS2" -AsObject
$Network = Invoke-VMScript -VM "Windows Server" -GuestCredential $GC -ScriptType Powershell -ScriptText "(gwmi Win32_NetworkAdapter -filter 'netconnectionid is not null').netconnectionid"
$NetworkName = $Network.ScriptOutput
$NetworkName = $NetworkName.Trim()
$netshIP = "c:\windows\system32\netsh.exe interface ip set address ""$NetworkName"" static $VMINFO.IP $VMINFO.SubnetMask $VMINFO.Gateway"
$netshDNS = "c:\windows\system32\netsh.exe interface ip set dnsservers ""$NetworkName"" static $VMINFO.DNS1"
$netshDNS2 = "c:\windows\system32\netsh.exe interface ip add dnsservers ""$NetworkName"" $VMINFO.DNS2"
Invoke-VMScript -VM $VMINFO.VMname -GuestCredential $GC -ScriptType bat -ScriptText $netshIP
Invoke-VMScript -VM $VMINFO.VMname -GuestCredential $GC -ScriptType bat -ScriptText $netshDNS
Invoke-VMScript -VM $VMINFO.VMname -GuestCredential $GC -ScriptType bat -ScriptText $netshDNS2
Write-Host "Setting IP address completed." -ForegroundColor Green