Run command on Cisco IOS network devices. Switches and routers.
Install-Script -Name Invoke-CiscoCommand
Run command on Cisco IOS network devices. Switches and routers.
License: MIT License
Run command on Cisco IOS network devices. Switches and routers.
Install-Script -Name Invoke-CiscoCommand
To add some error handling I tried to use the try-catch syntax when calling the Invoke-CiscoCommand but this resulted in the first run succeeding but all subsequent runs failed with the error message below. I am looping through a set of Cisco switch IPs so I can create a file using ConvertTo-CSV and have a file for each switch. After the loop finished the Get-SSHSession showed a new session open for each subsequent call to invoke-ciscocommand.
`Get-CiscoFCNS -IPAddress 10.xxx.xx.xxx -Credentials System.Management.Automation.PSCredential
Invoke-CiscoCommand -IPAddress 10.xxx.xx.xxx -command 'show fcns database local detail | json native' -Credential System.Management.Automation.PSCredential
Get-CiscoFCNS : Cannot convert value "Stream found for {0}" to type "System.Int32". Error: "Input string was not in a correct format."
At C:\Support\Scripts\GatherCiscoSanSwitchConfigs.ps1:126 char:15
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Running a cisco show command piped to json native results in some very long lines which were being split with a newline. This resulted in json which was invalid and could not be processed by ConvertFrom-Json. I had to edit the Invoke-CiscoCommand.psi and add terminal -width 511 to line 203 of your script to resolve this issue. You may want to consider adding this.
$Global:SshStream.WriteLine('terminal length 0 ; terminal width 511')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.