Closed Scepticalist closed 7 years ago
https://blogs.vmware.com/PowerCLI/2016/04/powercli-best-practice-correct-use-strong-typing.html
Instead of updating the type to another implementation type, we should follow the recommendation in the above link to be resilient to future PowerCLI changes. [VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine]
Submitted my first ever pull request for this. Hope I followed the contribution guidelines OK.
Excellent- I hadn't seen that article on types. I'll edit my implementation - thanks for the submission
Awesome, I hadn't seen that article as well. Thanks for your contribution, I've merged the pull just now. In future, you just need to bring your branch up to date before submitting the pull request. That way it's much easier to merge into the repository.
Edit the plugin "00 Connection Plugin for vCenter" as follows:
In the two function definitions Get-VMLastPoweredOffDate and Get-VMLastPoweredOnDate:
Replace
VMware.VimAutomation.ViCore.Impl.V1.Inventory.VirtualMachineImpl
With
VMware.VimAutomation.ViCore.Impl.V1.VM.UniversalVirtualMachineImpl