Tuesday, 20 October 2015

Function to get 7-Mode Transition Volume Information

A simple function to get 7-Mode transition volume information -

Function Get-7MTransitionVolInfo {
  Param([Parameter(Mandatory=$TRUE,HelpMessage="Volume to be transitioned to cDOT")][String]$Volume)
  $GetNaVol = Get-NaVol -Name $Volume -Terse -ErrorAction SilentlyContinue
  If(!$GetNaVol){ RETURN $NULL }
  $GetNaVolOption   = Get-NaVolOption   -Name $Volume
  $GetNaVolLanguage = Get-NaVolLanguage -Name $Volume
  RETURN @{
    "SizeTotal"   = $GetNaVol.SizeTotal
    "SizeUsed"    = $GetNaVol.SizeUsed
    "Language"    = $GetNaVolLanguage.LanguageCode
    "Guarantee"   = ($getnavoloption | where { $_.name -eq "actual_guarantee" }).value
    # The following 3 options should be off:
    "NoI2P"       = ($getnavoloption | where { $_.name -eq "no_i2p" }).value
    "ReadRealloc" = ($getnavoloption | where { $_.name -eq "read_realloc" }).value
    "NvFail"      = ($getnavoloption | where { $_.name -eq "nvfail" }).value
  }
}

- just supply the 7-Mode volume and the info comes back.

No comments:

Post a Comment