Microsoft Virtualization Discussions


Invoke-NaSsh passing multiple commands to Cisco MDS


Working on script to set some standard settings on Cisco MDS switches using the Invoke-NaSsh from the PowerShell Tool kit. I can pass a single command (i.e. SHOW VSAN 1), but passing multiple commands (i.e. CONFIGURATION TERMINAL;SYSTEM DEFAULT SWITCHPORT SHUTDOWN;EXIT), I get a Cmd exec error.


I can stack the commands in format above with PLINK (PuTTY CLI), but can ot seem to get it work with Invoke-NaSsh


Current CMD line:

Invoke-NaSsh -name $switchIP -command "configure terminal;system default switchport shutdown;exit" -credential $credentials -ErrorAction SilentlyContinue -WarningAction SilentlyContinue 


Re: Invoke-NaSsh passing multiple commands to Cisco MDS

The only thing I can say is from my experience is that the stacked commands work for netapp, i'm not sure if they work for cisco. 

Check out the KB!
Knowledge Base
All Community Forums