Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 228535

Re: Script to get VAAI Status

$
0
0

The indication System.Object[] is the way Export-Csv indicates that you are trying to store an array into a column.

To get single values, you have to use some nested forach loops.

Something like this for example

 

Get-VMHost|

ForEach-Object-Process {

    $esxcli=Get-EsxCli-VMhost $_-V2

    $esxcli.storage.core.device.list.Invoke()|

    ForEach-Object-Process {

        $row=$_

        $esxcli.storage.core.device.vaai.status.get.Invoke(@{device=$row.Device})|

        ForEach-Object-Process {

            $row|Add-Member-Name VAAIPluginName -Value $_.VAAIPluginName-MemberType NoteProperty -PassThru |

            Add-Member-Name ATSStatus -Value $_.ATSStatus-MemberType NoteProperty -PassThru |

            Add-Member-Name CloneStatus -Value $_.CloneStatus-MemberType NoteProperty -PassThru |

            Add-Member-Name DeleteStatus -Value $_.DeleteStatus-MemberType NoteProperty -PassThru |

            Add-Member-Name ZeroStatus -Value $_.ZeroStatus-MemberType NoteProperty -PassThru

        }

    }

}|Export-Csv-Path .\report.csv -NoTypeInformation -UseCulture


Viewing all articles
Browse latest Browse all 228535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>