<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Question regarding Convertto-formattednumber in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/14985#M769</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So this is a basic simple question, when using the convertto-formattednumber cmdlet it nicely formats the data into either TB, GB, MB, etc....&amp;nbsp;&amp;nbsp; I've been looking at the cmdlet and seeing if there is a way to make the output consistent in either all GB or TB, etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been unsuccessful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i've done so far, it's ugly, but it's my desired result is something like this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;get-navol | Select Name,Aggregate,@{E={[Math]::round(($_.Totalsize/(1024*1024))/1024,2)};Name = "Total Size (GB)"},@{E={[Math]::round(($_.sizeused/(1024*1024))/1024,2)};N = "Used (GB)"},@{E={[Math]::round(($_.Available/(1024*1024))/1024,2)};N = "Available (GB)"} | Sort Aggregate | ft -autosize&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only reason why i'm doing this is quick calculation to excel to figure out free space on the aggrs quickly.. you can just add them up in excel if you pipe to export-csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just curious if there was an easier way&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jun 2025 06:18:20 GMT</pubDate>
    <dc:creator>JGPSHNTAP</dc:creator>
    <dc:date>2025-06-05T06:18:20Z</dc:date>
    <item>
      <title>Question regarding Convertto-formattednumber</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/14985#M769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So this is a basic simple question, when using the convertto-formattednumber cmdlet it nicely formats the data into either TB, GB, MB, etc....&amp;nbsp;&amp;nbsp; I've been looking at the cmdlet and seeing if there is a way to make the output consistent in either all GB or TB, etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been unsuccessful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i've done so far, it's ugly, but it's my desired result is something like this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;get-navol | Select Name,Aggregate,@{E={[Math]::round(($_.Totalsize/(1024*1024))/1024,2)};Name = "Total Size (GB)"},@{E={[Math]::round(($_.sizeused/(1024*1024))/1024,2)};N = "Used (GB)"},@{E={[Math]::round(($_.Available/(1024*1024))/1024,2)};N = "Available (GB)"} | Sort Aggregate | ft -autosize&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only reason why i'm doing this is quick calculation to excel to figure out free space on the aggrs quickly.. you can just add them up in excel if you pipe to export-csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just curious if there was an easier way&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 06:18:20 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/14985#M769</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2025-06-05T06:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Convertto-formattednumber</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/14990#M770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ConvertTo-FormattedNumber doesn't accept units as an argument.&amp;nbsp; I wrote that one principally to support the Toolkit's data formatters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you just want to add up the available space, there's no need to export to Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;PS C:\&amp;gt; &lt;SPAN style="color: #0000ff;"&gt;Get-NaVol | Measure-Object Available -Sum | Select-Object -ExpandProperty Sum | ConvertTo-FormattedNumber -Type DataSize&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt; color: #0000ff;"&gt;338 GB&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 18:18:03 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/14990#M770</guid>
      <dc:creator>cknight</dc:creator>
      <dc:date>2012-09-25T18:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Convertto-formattednumber</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/14995#M771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clinton - Your a genius!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well that sure makes things easier...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; get-navol | measure-object Totalsize,Available,sizeused -Sum | select -expandproperty Sum | Convertto-formattednumber -type Datasize&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I just need to play around with getting into each aggr info.. sort of like aggr show_space -g, but neater...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 18:27:36 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/14995#M771</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2012-09-25T18:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Convertto-formattednumber</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15001#M772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is one issue i am having and i'm wondering what it could be..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from the console if i run aggr show_space -g or vol size on a specific volume it shows as 4560GB, but with powershell it shows 3.5tb.&amp;nbsp; Wierd, I can't figure that one out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 18:32:19 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15001#M772</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2012-09-25T18:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Convertto-formattednumber</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15007#M773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may have to consider things like snapshot reserve, WAFL reserve, etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 18:34:35 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15007#M773</guid>
      <dc:creator>cknight</dc:creator>
      <dc:date>2012-09-25T18:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Convertto-formattednumber</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15011#M774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clinton - Good point.. I just checked it's totally snapshot reserve.. Omg, I totally overlooked that... I know this is off topic from the original thread, but to me that makes things pretty confusing.. I was under the impression that get-navol was similiar to vol size where it tells you the entire volume.. If snapshot reserve is enabled at 20% it can totally throw off the automation of scripting..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 18:42:47 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15011#M774</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2012-09-25T18:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Convertto-formattednumber</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15016#M775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clinton - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; get-navol vol0 | get-navolsize | Select @{E={convertto-formattednumber $_.volumesize datasize "0.00"};N = "Volumesize"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That wll give us the true vol size if snapshot reserve is on.&amp;nbsp; Hmm. To me, I feel like we should represent that in Get-navol,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if I want to provision a new filer, i use the $_.totalsize property to do so, but that's technically incorrect.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 18:54:55 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15016#M775</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2012-09-25T18:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Convertto-formattednumber</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15021#M777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree the APIs for space reporting aren't perfect.&amp;nbsp; Adding a call to the vol-size API inside Get-NaVol would add an API call for &lt;EM&gt;each volume&lt;/EM&gt;, whereas Get-NaVol gets all the data in a small number of calls, so we'd not want to slow it down like that.&amp;nbsp; At least it's better in Cluster Mode.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 19:00:27 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15021#M777</guid>
      <dc:creator>cknight</dc:creator>
      <dc:date>2012-09-25T19:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Convertto-formattednumber</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15025#M779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clinton -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx for the reply - I agree with your statement on multiple calls, but the get-navol totalsize isn't a true representation.. I can't believe i've missed this before, most of the time, i deal with snapshot reserve of 0, but it just so happens, I was looking at this closer today and they didn't jive.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 19:17:21 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15025#M779</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2012-09-25T19:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Convertto-formattednumber</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15030#M780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So Clinton - i've been racking my brain for a little to try to figure out the best way to get a better representation of the storage..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was trying stuff like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$vols = get-navol&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$vols | % {&lt;/P&gt;&lt;P&gt;$volsize = get-navolsize $_.name | Select @{E={convertto-formattednumber $_.volumesize datasize "0.00"}&lt;/P&gt;&lt;P&gt;Write-host "Volume name: " $_.name "`tVolumeSize: " $volsize &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But that totally fails..&lt;/P&gt;&lt;P&gt;Ultimately, I would like to be ale to get true volume size as to when we build a new filer, and snapshot reserve is set I can get the true volume size and as well for reporting..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where am I going wrong here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2012 15:21:57 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15030#M780</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2012-09-28T15:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Convertto-formattednumber</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15034#M781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's one way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS C:\&amp;gt; $volSizeMap = @{}&lt;/P&gt;&lt;P&gt;PS C:\&amp;gt; $vols | % { $volSizeMap[$_.Name] = (Get-NaVolSize $_ | select -ExpandProperty VolumeSize | ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00") }&lt;/P&gt;&lt;P&gt;PS C:\&amp;gt; $volSizeMap | ft -AutoSize&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Sep 2012 18:40:47 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15034#M781</guid>
      <dc:creator>cknight</dc:creator>
      <dc:date>2012-09-30T18:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Convertto-formattednumber</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15039#M782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clinton -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is brilliant as usual.&amp;nbsp; I'm sitting here wondering how you are stuffing the array, and why I can' t pull aggregate information as well..&amp;nbsp;&amp;nbsp; I basically want $volsizemap array to encompass stuff from get-navol, So example, I really want $_.totalsize $_.totalused - etc... I'm having trouble with the concept of this array.&amp;nbsp;&amp;nbsp; I just don't understand it and i'll be the first to admit it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 15:51:39 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15039#M782</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2012-10-01T15:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Convertto-formattednumber</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15044#M783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It isn't an array, it's a hashtable that maps volume name to formatted volume size.&amp;nbsp; There are plenty of other ways to do what you want, but this seemed straightforward enough.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 17:08:27 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15044#M783</guid>
      <dc:creator>cknight</dc:creator>
      <dc:date>2012-10-01T17:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding Convertto-formattednumber</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15049#M784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah - hash table, Cool.&amp;nbsp; Thx...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So.. anyways,.. I still need to get it in a format where it shows all the true columns, better for report, but here's my thought process around scripting new vols when provisioning snapmirror targets or just messing around in the lab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$vols | % {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if ($_.snapshotpercentreserved -eq 0) {&lt;/P&gt;&lt;P&gt; write-host "No Snapshot Reserve Name: " $_.name }&lt;/P&gt;&lt;P&gt;new-navol -name $_. name -aggregate aggr1 -spacereserve none -size $_.totalsize -controller $dstfiler&lt;/P&gt;&lt;P&gt; elseif ($_.snapshotpercentreserved -gt 0) {&lt;/P&gt;&lt;P&gt; write-host "Snapshot reserve volume: " $_.name&amp;nbsp; "`tSnapshotReserve%" $_.snapshotpercentreserved}&lt;/P&gt;&lt;P&gt;$volsize = get-navolsize $_.name &lt;/P&gt;&lt;P&gt;new-navol -name $_. name -aggregate aggr1 -spacereserve none -size $volsize&amp;nbsp; -controller $dstfiler&lt;/P&gt;&lt;P&gt; }&lt;/P&gt;&lt;P&gt;## Close loop&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That was my thought process... I haven't tested the above code, but in theory it should work.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 18:17:11 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Question-regarding-Convertto-formattednumber/m-p/15049#M784</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2012-10-01T18:17:11Z</dc:date>
    </item>
  </channel>
</rss>

