tryig to setup static ip on windows VM using alan script. but not working...
How did you call that Set-WinVMIP function?Which parameters did you pass?
hi luc
set-winvmip -VM myvmname -IP 192.168.0.100 -SNM 255.255.255.0 -GW 192.168.0.1 -DNS1 8.8.8.8 -DNS2 4.4.4.4
Seems to work ok for me.How and from where do you run that code?Can you provide a screenshot with the full error mesage?
Ok, the error is coming from the script running inside the Guest OS.For one reason or another the variable substitution on $cmd didn't work.Try doing it like this
not sure what happened but when i try to reload the function
. .\set-winvmip.psm1
it does not see or recognize the funtion
Why .psm1, and not .ps1?
ok now I get The request operation requires elevation. (run as administrator)
my guest cred is an administrator
Then you should probably look at what the UAC settings inside the Guest OS are.The best bypass is disabling UAC, if that is permitted.You could also try something like Re: Invoke-VMScript to run ps commands as an admin... - VMware Technology Network VMTN