Skip to content

Invoke KNCommand

Alexander Ryzhov edited this page Mar 17, 2021 · 1 revision

Invoke-KNCommand

SYNOPSIS

Run CLI command just like SSH/Telnet console

SYNTAX

Invoke-KNCommand [-Session <KNSession>] [[-Command] <String>] [<CommonParameters>]

DESCRIPTION

CLI emulator with autocomplete support

EXAMPLES

ПРИМЕР 1

Invoke-KNCommand 'show version'

Return 'show version' result as appropriate CLI command do

PARAMETERS

-Session

Existing connection session. Default session used if parameter omitted.

Type: KNSession
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: $Global:DefaultKNSession
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Command

CLI command, i.e. 'show version' We should return one string with quotation marks, that's the way to keep CLI command with all arguments as the one PS function parameter. Without quotations 'show version' will be interpreted by PS as two parameters. Feed RCI with no quotation marks, remove them if necessary

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

RELATED LINKS

https://github.com/ryzhovau/keenetic-powershell