The "-controller" parameter is expecting an object of type NetApp.Ontapi.Filer.NaController, not of type System.String.
As a result, the code below is correct.
$netappCred = Get-Credential -Credential "root"
$controller = Connect-NaController -Name "filername" -Credential $netappCred
$vols = Get-NaVol -Controller $controller
The code below here, is incorrect
$netappCred = Get-Credential -Credential "root"
$controller = Connect-NaController -Name "filername" -Credential $netappCred
$vols = Get-NaVol -Controller "filername"
I hope this helps.
Bill