Make sure you set your execution policy to unrestricted.
Is your storage controller joined to the domain? If so, then is your domain account (logged on with) a member of the storage controllers administrator's group?
If yes, then:
Import-Module dataontap
$filername = Read-Host "What is the filer hostname?"
Connect-NaController -Name $filername | out-null
$volname = Read-Host "What is the volume name (case sensitive)?"
$volsize = Get-NaVolSize $volname
Write-Host "The size of the volume is:"$volsize.volumesize
If no, then:
Import-Module dataontap
$filername = Read-Host "What is the filer hostname?"
Connect-NaController -Name $filername -Credential (get-credential) | out-null
$volname = Read-Host "What is the volume name (case sensitive)?"
$volsize = Get-NaVolSize $volname
Write-Host "The size of the volume is:"$volsize.volumesize