VMware Cloud Community
jojo130374
Enthusiast
Enthusiast

VM field change with vSphere 7 ?

Hello

We have upgraded our infrastructure with vsphere 7.0 U1. We used a powershell script to list VM before upgrade.

In this script, we retrieved VM folder with this fied in vsphere 6 :  $vm.folder

It seems this filed has been changed .

I am looking for the command in vsphere 7 equivalent to $vm.folder

Also, I looking for the reference guide of commands and field structure  .

Thanks

Regards

Moderator edit by wila: Moved post to VMware PowerCLI discussions

Labels (1)
Tags (1)
0 Kudos
2 Replies
LucD
Leadership
Leadership

Without showing the actual code you are using, there can be anything in your $vm variable.

Assuming that it is the object returned by Get-VM, the Folder property is still there in the VirtualMachine object.
And again assuming that you want the Name of the Folder, the actual property you probably want is $vm.Folder.Name.

Otherwise, you are relying on how PS converts the Folder object to a String.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

jojo130374
Enthusiast
Enthusiast

Hello

Thanks .

We have solved the issue . We had an old release of  powercli. After installing the new version, it worked

 

 

0 Kudos