That's my final one that works in a workflow:
param (
[parameter(Mandatory=$true, HelpMessage="Array name or IP address")]
[string]$Array,
[parameter(Mandatory=$true, HelpMessage="Full path to filer or vfiler requested file, example: hosts")]
[string]$FilePath,
[parameter(Mandatory=$true, HelpMessage="New Line to enter to the configuration file. One line at a time.")]
[string]$LineEntered
)
# connect to controller
Connect-WfaController -Array $Array
$rootvol=Get-NaVolRoot
$fullpath="/vol/" + $rootvol.Name + "/etc/" + $FilePath
# Write the line to the file.
Write-NaFile -Path $fullpath -Append -Data $("`n" + "$LineEntered" + "`n")
# End of Command