Looks like PowerShell can't find the PowerCLI modules.
Where are the modules?
And what is in $env:PSModulePath?
Is the folder where PowerCLI is installed included in there?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Looks like PowerShell can't find the PowerCLI modules.
Where are the modules?
And what is in $env:PSModulePath?
Is the folder where PowerCLI is installed included in there?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That looks to be a rather old PowerCLI version.
Can you remove those folders, and then do an Install-Module -Name VMware.PowerCLI from the PS prompt?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Looks like this one Unable to install NuGet provider for PowerShell
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks.
I tried that and it worked.
But now when I go back to try and update the modules, not sure it went all the way through.
It went to complete almost all the way, then I got some kind of red error.
Already closed out of it, so it won't show it to me again if I run the same cmd.
I checked the Modules folder. It's still empty; no new modules installed.
Add the Verbose switch on the Install-Module cmdlet.
Install-Module -Name VMware.PowerCLI -Verbose
Run this from a PS prompt, not from within the editor.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Looks like PowerCLI is installed.
Check with
Get-Module -Name VMware* -ListAvailable
The modules are probably installed in one of the official module folders.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yup. I got a bunch of results. Now how do I get my script to work?
Did you already try to run your script, after installing the PowerCLI modules?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I think the error message is clear, the Connect-VIServer can't reach your VCSA.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I finally got it figured out. Now I just have 1 warning showing.
"WARNING: GuestID property is deprecated. Please use ConfiguredGuestId and RunTimeGuestId properties instead."
I don't have GuestID in my script, so not sure why I see that. Not sure where to put the newer codes at and what to put with it.
Here is my current script:
connect-VIServer -Server Server1.Domain.com -Protocol HTTPS
Set-PowerCLIConfiguration -InvalidCertificateAction ignore -Confirm:$false
SHUTDOWN-VMGuest -VM Server2 -Confirm:$false
SHUTDOWN-VMGuest -VM Server3 -Confirm:$false
You can safely ignore that warning
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
So even though it's deprecated, I shouldn't ever have to update my code in the future if one of those codes becomes obsolete, as the error suggests?
That warning has been there for quite some time now.
Since you are actually not using that parameter, you shouldn't have to update your code.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Awesome, thanks.