Microsoft Virtualization Discussions

Size of values when i export CSV powershell

anthony69300

Hello,

 

i need to see the size of all snapshot, on all volumes.

I usthis command in powershell cli :

 

 Get-NaVol vol* | Get-NaSnapshot | select TargetName,Name,Created,Total,CumulativeTotal,Dependency | ft -AutoSize

 

The output is good and in GB size for values Total and CumulativeTotal.

 

I try this command to export in CSV :

 

 Get-NaVol vol* | Get-NaSnapshot | select TargetName,Name,Created,Total,CumulativeTotal,Dependency | export-csv <mypath>

 

But when i try to export the output in CSV, the value of Total and CumulativeTotal appears in byte in my CSV file.

Someone can help me ?

 

Thank you

 

Thank you

1 REPLY 1

JGPSHNTAP

you need to use custom select statements with convertto-formattednumber cmdlet or .net [math]:: functions

 

select @{n='size';e={convertto-formattednumber $_.total datasize "0.0"}}

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public