Need help with this simple script
$datastores = Get-Datastore -Location "CXXX" | Where-Object {$_.ExtensionData.Info.GetType().Name -eq "VmfsDatastoreInfo"}
$myColCurrent = @()
ForEach ($store in $datastores)
{
$myObj = "" | Select-Object Name, devicename
$myObj.Name = $store.name
Write-Host $myObj.Name
$myObj.devicename = $store.ExtensionData.Info.Vmfs.Extent.DiskName
Write-Host $myObj.devicename
the datastore name is writtenl correctly but the devicename is blank and get this warning:
WARNING: The 'Accessible' property of Datastore type is deprecated. Use the 'State' property instead.
Strange part is the Script works lab powercli connecting to the lab vcenter. But, gives the error in production powecli server to prod vcenter. the powercli and vcenter server versions are the same.
A help is greatly appreciated