One of the many enhancements found in PowerCLI 6 R1 is that several cmdlets were renamed. This was done in an effort to better align with Microsoft’s cmdlet naming standard and to be consistent across products. This will also help individuals learn the PowerShell and cmdlet names faster because of the consistency.
So, what changed?
There were three cmdlets that have been renamed:
- Shutdown-VMGuest is now Stop-VMGuest
- Apply-VMHostProfile is now Invoke-VMHostProfile
- Apply-DrsRecommendation is now Invoke-DRSRecommendation
Do I have to change my scripts to work with the new cmdlets?
The short answer is no… To explain, we renamed the previous cmdlets, however, we also added their old cmdlet names onto the new cmdlets as aliases. This will allow all of your scripts that contain these cmdlets to continue to function properly without needing to change your scripts. However, if you do want to modify your scripts to align with the new cmdlets, all the better. Think of it as part of your virtual spring cleaning.
To do a quick search for any script that may contain one of these three cmdlets, you can run the following command in PowerShell:
Get-ChildItem -Include *.ps1 -Recurse | Select-String -Pattern Shutdown-VMGuest, Apply-VMHostProfile, Apply-DrsRecommendation