We are only two months in to 2018, but it has already been pretty exciting from an automation standpoint. Let’s review some of the big news. Microsoft open-sourced and released PowerShell 6.0. They also made it available on a number of operating systems, from Windows to Linux to Mac OS. Then, PowerCLI hit 2,000,000 downloads from the PowerShell Gallery! Today, we are releasing VMware PowerCLI 10.0.0!
Let’s talk about the version change for a second. If you’ve been a PowerCLI user for a couple years, you have probably noticed quite the transformation here recently. One item of note was when the name was changed from vSphere PowerCLI to VMware PowerCLI. This was due to PowerCLI’s ability to manage more than just vSphere. With this release, we are taking that next step to remove ourselves from being in lockstep with vSphere’s versioning. Why did we go with 10? Well, PowerCLI recently celebrated its 10th birthday so it seemed like the perfect number!
Time to take a look at everything that’s new!
Multi-Platform Support
PowerCLI 10.0.0 adds support for Mac OS and Linux! The only pre-requisite is to have PowerShell Core 6.0 installed. The installation process is also the same:
1 |
Install-Module -Name VMware.PowerCLI -Scope CurrentUser |
This release brings support for the following modules:
- VMware.VimAutomation.Cis.Core
- VMware.VimAutomation.Common
- VMware.VimAutomation.Core
- VMware.VimAutomation.Nsxt
- VMware.VimAutomation.Vds
- VMware.VimAutomation.Vmc
- VMware.VimAutomation.Sdk
- VMware.VimAutomation.Storage
- VMware.VimAutomation.StorageUtility
Future releases of PowerCLI will continue to add support for the remaining modules.
Default Certificate Handling
This version changes the way certificates are handled when connecting to a vCenter server or ESXi host with the Connect-VIServer cmdlet. If your connection endpoint is using an invalid certificate (self-signed or otherwise), PowerCLI would previously return back a warning. The handling has been updated to be more secure and now return back an error.
If you are using an invalid certificate, you can correct the error with the ‘Set-PowerCLIConfiguration’ cmdlet. The parameter needing to be configured is ‘InvalidCertificateAction’ and the available settings are Fail, Warn, Ignore, Prompt, and Unset.
The following code will configure the ‘InvalidCertificateAction’ parameter to be Ignore:
1 |
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore |
Deprecated Cmdlets and Property
There are five cmdlets being deprecated. These cmdlets are found in the VMware.VimAutomation.Core module. They are:
- Get-VMGuestNetworkInterface
- Set-VMGuestNetworkInterface
- Get-VMGuestRoute
- New-VMGuestRoute
- Remove-VMGuestRoute
These cmdlets are replaced with the use of the Invoke-VMScript cmdlet.
Sample code to change the IP Address of a Windows VM:
1 2 3 4 5 |
$ipAddr = "192.168.10.25" $subMask = "255.255.255.0" $gw = "192.168.10.1" $netsh = "c:\windows\system32\netsh.exe interface ip set address ""Local Area Connection"" static $ipAddr $subMask $gw 1" Invoke-VMScript -VM $VM -GuestCredential $creds -ScriptType bat -ScriptText $netsh |
One other deprecation is to the Client property. If you have any scripts that are making use of the ‘Client’ property, you’ll want to get those updated to use the ServiceInstance managed object. More information can be found at the following: ServiceInstance
Resolved Issues
First, I want to thank the community for this section. There was an overwhelming amount of feedback that came in and I’m quite excited about how many items we were able to get resolved! Let’s check some of them out:
- Piping the Get-Datacenter cmdlet output to Get-Cluster now works when more than one datacenter is present
- Configuring manual MAC addresses with the New/Set-NetworkAdapter cmdlet now accepts all addresses, not just MAC addresses in the 00:50:56 range
- VMs with snapshots can be Storage vMotioned to VMFS6 datastores without hitting a ‘redoLogFormat’ error
- Lots of updates to the Get-TagAssignment cmdlet, including when connected to two vCenter Servers and also displays the Tag Category as expected
Summary
Today, we release PowerCLI 10.0.0. This release adds support for PowerShell Core 6 which can be run on Linux and Mac OS systems. There are also a handful of VMGuest related cmdlets which have been removed from the release. Their functionality can be replaced with the usage of Invoke-VMScript. Lastly, there have been several corrections. Many of which are thanks to our amazing community for bringing them to our attention.
Remember, updating your PowerCLI modules is now as easy as:
1 |
Update-Module VMware.PowerCLI |
For more information on changes made in VMware PowerCLI 10.0.0, including improvements, security enhancements, and deprecated features, see the VMware PowerCLI Change Log. For more information on specific product features, see the VMware PowerCLI 10.0.0 User’s Guide. For more information on specific cmdlets, see the VMware PowerCLI 10.0.0 Cmdlet Reference.
The VMware PowerCLI Change Log is not updated yet with VMware PowerCLI 10.0.0 information.
Import-Module : VMware.VimAutomation.Srm module is not currently supported on the Core edition of PowerShell
Think you missed something 😀
i am in the same boat!
When we use the “Update-Module VMware.PowerCLI” command it downloads the new version and keeps the old versions installed.
There is a way to update a module removing the older versions of it?
This is not a PowerCLI thing but just how PowerShell updates modules. I wrote this to remove all but the current version of modules on my system. This isn’t just PowerCLI but all modules on my system installed from the PowerShell Gallery…
Get-InstalledModule | ForEach-Object {
$CurrentVersion = $PSItem.Version
Get-InstalledModule -Name $PSItem.Name -AllVersions | Where-Object -Property Version -LT $CurrentVersion
} | Uninstall-Module -Verbose
If you only want to remove older version of PowerCLI and leave older versions of other modules you could use this instead…
Get-InstalledModule -Name VMware.PowerCLI | ForEach-Object {
$CurrentVersion = $PSItem.Version
Get-InstalledModule -Name $PSItem.Name -AllVersions | Where-Object -Property Version -LT $CurrentVersion
} | Uninstall-Module -Verbose
Oh I forgot to add that VMware.PowerCLI has dependencies which each will fail to uninstall due to being dependencies. You can force these to uninstall by add a -Force to the very end of the script…
Get-InstalledModule | ForEach-Object {
$CurrentVersion = $PSItem.Version
Get-InstalledModule -Name $PSItem.Name -AllVersions | Where-Object -Property Version -LT $CurrentVersion
} | Uninstall-Module -Verbose -Force
Andrew Palmer,
Thanks! I’ve added the “-Force” parameter to my script of module cleaning.
Does the new cert requirement work with internal CA’s. I have a trusted cert on my server, but still get an invalid cert error when attempting to connect the client.
It’s not just you; I reported it yesterday (and opened a support case today) and I’ve seen a few others report it in the Slack channel
Good to know I am not alone. Would love to know what they come back with.
Is there a package/offline installation option? i’m having no success from behind proxy despite other functions and access from Powershell 6.0 working.
You can download it on another computer …
PS C:\> Save-Module -Name VMware.PowerCLI -Path c:\temp\vmware
This! Jeez, just give us a download link!
Connect-VIServer errors with “Method not found: ‘Void Vmware.Binding.Sts.VmwareSecruityTokenService..ctor(System.Uri)’.”
Guessing the problem is ‘Security’ is typoed?
I am having the same issue except only when I attempt to connect to a VCSA 6 server. I have no issue connecting to VC 5.5.
Doh! I didn’t pay close enough attention to Vandrey’s comment–the dumb Update/Install-Module commands are basically doing nothing; I’ve still got *ONLY* 6.5.0 after both commands. @#$#@#ing PowerShell!
Install-Module -Name VMware.PowerCLI -Scope CurrentUser resulted in only installing the following modules
Script 10.0.0…. VMware.VimAutomation.Core
Script 10.0.0…. VMware.VimAutomation.Vds
I’ve tried running the command multiple times.
Can we PLEASE have the MSI installer back? Here is the issue I am running in to when I try the offline method of importing the module:
C:> Import-Module vmware.powercli
Import-Module : Exception calling “OnImportModule” with “2” argument(s): “The type initializer for
‘VMware.VimAutomation.Cis.Nsxt.Interop.V1.NsxtServiceFactory’ threw an exception.”
At line:1 char:1
+ Import-Module vmware.powercli
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Import-Module], MethodInvocationException
+ FullyQualifiedErrorId : TypeInitializationException,Microsoft.PowerShell.Commands.ImportModuleCommand
This is a new install of PowerCLI with no previous installations. The modules are there when I list them as well.
I have not been able to get this to work since it was released. I am running PowerShell 5.1 and PowerShell 6.0 (Core) on my machine. In 5.1 I get an error where the log4net assembly fails to load, and on 6.0 I am presented with VMware.VimAutomation.Srm module is not currently supported on the Core edition of PowerShell. I’m pulling my hair out trying to get this to work, and am now at the point of fallback to 6.5.4. I really don’t see how this made it to a shipped version since it doesn’t work with either version of PowerShell that I have for Windows 10.
I am unable to get this to work with PowerShell 5.1 or PowerShell 6.0 (Core). In 5.1 I fail to load log4net, and in 6.0 it fails to import VMware.VimAutomation.Srm as it’s not supported. I’m falling back to 6.5.4, which is really unfortunate. Nothing about 10.0 works for me in Windows 10.
Ensure your antivirus isn’t blocking the install. 95% of the time with these issues, AV is blocking the DLL.
Outside of that, feel free to open a support ticket.
Issues, Issues, Issue! First the Install-Module -Name VMware.PowerCLI -Scope CurrentUser does not install all modules! I just get
VMware.VimAutomation.Cis.Core
VMware.VimAutomation.Common
VMware.VimAutomation.Sdk
Second issue is why -scope current user? This just installs the module for one user (.\Documents\WindowsPowerShell\Modules). Can we use allusers, so it installs to C:\Program Files\WindowsPowerShell\Modules?
There may have been an issue with the PowerShell Gallery if that’s all you received. Remove the modules (Get-Module VMware.* -ListAvailable | Uninstall-Module OR delete the module folders from your $PSHome directory) and attempt the install again.
Second part, certainly. You just need to open your PowerShell session as administrator first.
In Linux, i had to
sudo pwsh
in order to install powerCLI. Does anyone know what would have been more proper? (usergroup or something?)Did you happen to add “-Scope CurrentUser” to the command?
Having to sudo means you probably installed PowerCLI for all users on that system.
i would indeed want it for all users, but moreover, installing gave me permissions errors (that i did not record) so i was forced to sudo pwsh
you’re right, i purged as sudo, then tr-tried with curtentuser which worked.
Import-Module : VMware.VimAutomation.HorizonView module is not currently supported on the Core edition of PowerShell.
Something not working on linux…
Wow. I tried to get PowerCLI 10 working on PowerShell Core on a Linux system a few weeks ago, and even tho I got it running I was unable to benefit from it because all I use PowerCLI for is Autodeploy configuration. Now, I just updated my Windows management station to PowerShell Core (because I borked something else up) and found out I can’t use PowerCLI for Autodeploy configuration there as well.
So, the only way to manipulate Autodeploy configurations is with PowerCLI (I’m not at vSphere 6.5 yet) and VMware.ImageBuilder does not support PowerShell Core EVEN ON WINDOWS. Seems like this release could have waited until ALL the functionality was available for at least one platform.
In my opinion, this is an Epic Fail, and makes me wish I hadn’t chosen Autodeploy at all.
Hi guys, i have this problem , anyone has the same ?
PS C:\Program Files\PowerShell\6-preview> Install-Module -Name VMware.PowerCLI –
Scope CurrentUser
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this
repository, change its InstallationPolicy value by running the Set-PSRepository
cmdlet. Are you sure you want to install the modules from ‘PSGallery’?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help
(default is “N”):y
PackageManagement\Install-Package : Unable to find an entry point named ‘CryptCA
TAdminAcquireContext2’ in DLL ‘wintrust.dll’.
At C:\program files\powershell\6-preview\Modules\PowerShellGet\1.6.0\PSModule.ps
m1:2057 char:21
+ … $null = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Microsoft.Power….InstallPackage:Insta
llPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : System.EntryPointNotFoundException,Microsoft.PowerShel
l.Commands.TestFileCatalogCommand,Microsoft.PowerShell.PackageManagement.Cmdlets
.InstallPackage
I am having the same issue except only when I attempt to connect to a VCSA 6 server. I have no issue connecting to VC 5.5
The new version of Powercli is good than previous version.
sharikat eazl fawm bialriyad Wonderful web site. Lots of useful information here. I’m sending it to several pals
Instant Help Zilla
great post
new post
such a great blog
i like this a blog
such a great website!!!
an AMAZING website
this is nice share thanks for sharing
an amazing website provides a lot of services in software field
Delta Jobs website offers a real opportunity for anyone who seeks a suitable job. The site offers various jobs in different fields such as administrative jobs, education and teaching jobs, customer service, technology and software, public relations, labor and technicians, drivers and other jobs.
an amazing website provides a lot of services in software field
an amazing website provides a lot of services in the software field
an amazing website provides a lot of services in software field
https://www.homefoum.com/شركة-عزل-فوم-بالرياض
an amazing website provides a lot of services in software field
The VMware PowerCLI Change Log is not updated yet with VMware PowerCLI 10.0.0 information.
this is nice share thanks for sharing
great post
an amazing website provides a lot of services in the software field
https://jant-mamlka.com/%D8%AA%D9%86%D8%B8%D9%8A%D9%81-%D8%A7%D9%84%D9%85%D9%86%D8%A7%D8%B2%D9%84-%D8%A8%D8%A7%D9%84%D8%B1%D9%8A%D8%A7%D8%B6/
We are only two months in to 2018, but it has already been pretty exciting from an automation standpoint. Let’s review some of the big news. Microsoft open-sourced and released PowerShell 6.0. They also made it available on a number of operating systems, from Windows to Linux to Mac OS. Then, PowerCLI hit 2,000,000 downloads from the PowerShell Gallery! Today, we are releasing VMware PowerCLI 10.0.0!
https://jant-mamlka.com/%D8%AA%D9%86%D8%B8%D9%8A%D9%81-%D8%A7%D9%84%D9%85%D9%86%D8%A7%D8%B2%D9%84-%D8%A8%D8%A7%D9%84%D8%B1%D9%8A%D8%A7%D8%B6/
thanks for the great info
Nice Blog.
Please visit us- https://opaquestudio.in/product-category/furniture/ottomans
ottoman online | buy ottomans online | ottoman furniture | storage ottoman | best ottoman | colorful ottoman
wilifilm.com est un site plateforme des film streaming Très Haute Qualité. ‘’Un streaming de Haute qualité et une expérience inédite’’ tel est notre slogan. Pour cela, nous avions pris le streaming des films au sérieux et donnons de notre mieux pour améliorer le service des film Streaming Partout au Monde.
https://wilifilm.com/film-streaming
Wonderful and very useful content in the field of programming. I benefited a lot. Thank you for publishing
We are glad that you visited سوق الجمعة https://www.souqfriday.com/
https://fananas1.blogspot.com/
fananas for seo
https://fananas1.blogspot.com/
kholudgamal03@gmail.com
https://siantk.com/
Thanks for the blog. http://www.fooddoz.com
an amazing online store
very good website
I agree with that ofcourse..
nice content really
What are the recent big news in the automation field that happened in early 2018, including the release of PowerShell 6.0 that can be used on multiple operating systems and PowerCLI reaching 2,000,000 downloads from PowerShell Gallery? And why was VMware PowerCLI 10.0.0 released with a version change that removes its dependency on vSphere versioning?
Thanks for sharing this blog. Please visit us at https://mach1.in/services
social media marketing | social media advertising company | social media marketing agency | social media agency | top social media companies | social media marketing company in noida
thanks for the information, great article, don’t forget to click on our bio too, maybe it can help you, https://www.qinayaprint.com