Microsoft Virtualization Discussions

first script

JSHACHER11
9,476 Views

Hi guys,

I started playing with powershell this week - I've tried to run the following but getting this:

"the size of the volume is DataONTAP.Types.Volume.SizeInfo"

the script is:

Import-Module dataontap

$filername = Read-Host 'What is the filer hostname?'

$name = Read-Host 'What is your username?'

Connect-NaController -Name $filername -Credential $name

$volname = Read-Host 'What is the volume name?'

$volsize = Get-NaVolSize -Name $volname

Write-Host "the size of the volume is:" $volsize

my debugger is saying that my problem is in this line:

$volsize = Get-NaVolSize -Name $volname

Thank you

1 ACCEPTED SOLUTION

cscott
9,426 Views

I am late to the discussion, but this is working for me:

Import-Module dataontap

$filername = Read-Host 'What is the filer hostname?'

$name = Read-Host 'What is your username?'

Connect-NaController -Name $filername -Credential $name

$volname = Read-Host 'What is the volume name?'

$volsize = Get-NaVolSize -Name $volname

Write-Host "the size of the volume is:" ($volsize).volumesize

What is the error that the debugger is throwing out?

-Scott

View solution in original post

32 REPLIES 32
Public