Forum Discussion

beighmie's avatar
beighmie
Novice I
2 years ago

I am new to Powershell and Slack so I applogize in

I am new to Powershell and Slack so I applogize in advance if I am doing thing wrong I have run into a strange issue querying my Pure array stats. When I run: ```write-host "Top 10 read IOPS" Get-Pfa2VolumePerformance -Array $FlashArray -Sort 'reads_per_sec-' -Limit 10 | Select-Object Name, Time, ReadsPerSec, BytesPerRead``` I get this output: Top 3 read IOPS Name Time ReadsPerSec BytesPerRead ---- ---- ----------- ------------ Volume1 11/1/2023 509 PM 1693 5747 Volume2 11/1/2023 509 PM 1381 12134 Volume3 11/1/2023 509 PM 158 14219 Then I try the same for the writes: ```write-host "Top 3 write IOPS" Get-Pfa2VolumePerformance -Array $FlashArray -Sort 'writes_per_sec-' -Limit 3 | Select-Object Name, Time, WritesPerSec, BytesPerWrite``` and I get this output: Top 3 write IOPS Name Time WritesPerSec BytesPerWrite ---- ---- ------------ ------------- Volume1 11/1/2023 511 PM 3742 60465 Volume2 11/1/2023 511 PM 1564 22167 Volume3 11/1/2023 511 PM 1471 13612 So far so good.... but when I run the commands back to back I was hoping to get 2 charts ```write-host "Top 3 read IOPS" Get-Pfa2VolumePerformance -Array $FlashArray -Sort 'reads_per_sec-' -Limit 3 | Select-Object Name, Time, ReadsPerSec, BytesPerRead write-host "Top 3 write IOPS" Get-Pfa2VolumePerformance -Array $FlashArray -Sort 'writes_per_sec-' -Limit 3 | Select-Object Name, Time, WritesPerSec, BytesPerWrite``` Instead, my output looks like this: Top 3 read IOPS Top 3 write IOPS Name Time ReadsPerSec BytesPerRead ---- ---- ----------- ------------ Volume1 11/1/2023 550 PM 1555 12201 Volume2 11/1/2023 550 PM 696 46596 Volume3 11/1/2023 550 PM 488 119497 Volume1 11/1/2023 550 PM Volume2 11/1/2023 550 PM Volume3 11/1/2023 550 PM Any guess why the 2 write-host outputs comes before the charts? and the second chart is missing the IOPS and Bytes? I assume I am missing something that tells powershell to run the commands in serial vs parallel? Thank you

4 Replies

  • Also, it maybe worth saving those into objects first, incase the information you are gathering is useful further in your script. ```$result1 = Get-Pfa2VolumePerformance -Array $FlashArray -Sort 'writes_per_sec-' -Limit 3| Select-Object Name, Time, ReadsPerSec, BytesPerWrite $result1|format-Table $result2 = Get-Pfa2VolumePerformance -Array $FlashArray -Sort 'reads_per_sec-' -Limit 3| Select-Object Name, Time, WritesPerSec, BytesPerWrite $result2|format-Table foreach($item in $result1){ write-host $item.name }```
  • probably not useful for raw metrics gathering, but if you say, wanted to email the results, you would need to save them to an object and craft them into an email body
  • Thank you. I had tried a few different things. I did end up saving them to objects, and adding |Format-table. they still gave me issues running them back to back. One fix that did work was also adding |Out-String to the end. This is all new to me, so not sure what that is doing, but I am getting the output I was looking for. Thank you!