In the past, I've used Invoke-NcSSH to administer Ontap clusters from a central location. i.e. I could pull the aggregate list from a cluster using a command like this:
Invoke-NcSSH -Controller ClusterName -Command "aggr show"
I also created a function to make the command shorter and allow me to run any OnTap CLI command on any cluster from a PowerShell window. The problem is that it requires Putty >0.70 to be installed (no big deal), but it's really really slow.
I thought that Posh-SSH might work better, but you first have to establish a session, find the session ID, invoke a session to that session ID, then parse the output to get the data that I need. This is what a Posh-SSH session looks like to do the same as what I'm doing with Invoke-NcSSH:
New-SSHSession -ComputerName ClusterName
Get-SSHSession
$var = Invoke-SSHCommand -SessionId 0 -Command "aggr show"
$var.Output
Does anyone have any fancy ways to make Posh-SSH work more like the way I was using Invoke-NcSSH above? Essentially, I'd like to be able to run an OnTap CLI command from PowerShell using a single PS command.
Thanks in advance for any hints anyone can give me!