Microsoft Virtualization Discussions

AutoSize

JSHACHER11
7,541 Views

Hi guys,

I would like to get the values of Autosize (maximum and increments) for all the volumes in the filer

I've tried 'Get-NaVol | Get-NaVolAutosize' but it gives no names of the volumes

any ideas?

Cheers

1 ACCEPTED SOLUTION

JGPSHNTAP
7,538 Views

Ah, when you write things quick in notepad this happens...  Ok, give this a whilr

$global=@()
[Int64]$Unit=1GB

$vols = Get-navol

$vols | % {

$volume = $_

$autosize = get-navolautosize $volume -ea "silentlycontinue"

If ($autosize.isEnabled) {


$customobject = new-object psobject
     add-member -inputobject $customobject -membertype noteproperty -name Volume -value $volume
     add-member -inputobject $customobject -membertype noteproperty -name Autosize -value "enabled"
     add-member -inputobject $customobject -membertype noteproperty -name Max -value ([System.Math]::Floor($autosize.maximumsize/$unit))
     add-member -inputobject $customobject -membertype noteproperty -name increment -value ([System.Math]::Floor($autosize.incrementsize/$unit))


$global += $customobject


}

}
$global | ft -autosize

and then you can dump it to excel

$global | export-csv c:\temp\autosize.csv -notypeinformation

View solution in original post

12 REPLIES 12
Public