-
Notifications
You must be signed in to change notification settings - Fork 4
Invoke KNRequest
POST/GET/DELETE requests to Keenetic REST API
Invoke-KNRequest [-Ci] [-Method <String>] [[-URL] <String>] [[-Body] <String>] [-OutFile <String>] [-Raw]
[-Headers <IDictionary>] [-Session <KNSession>] [<CommonParameters>]
This is a prototype for any other requests exposed from module.
Invoke-KNRequest show/version -Session $Session
Return a JSON response from 'show version' CLI command in active $session.
Invoke-KNRequest 'firmware' -Ci -OutFile fw_backup.bin -Raw
Download firmware via deprecated XML Core Interface (ci). Function will raise an exception if default session is not defined.
Use deprecated 'ci' XML Core Interface. Otherwise, REST Core Interface 'rci' wil be used (by default).
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Request method. Post/Get/Delete methods allowed. 'Get' by default.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Get
Accept pipeline input: False
Accept wildcard characters: False
URL, i.e. 'show/version'
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
POST request body. Optional for 'rci', mandatory for 'ci'.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the output file to save instead of returning it to pipe.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Don't try to interpret Keentic response as JSON/XML.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Request headers
Type: IDictionary
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
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
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
http://docs.help.keenetic.com/cli/3.1/en/cli_manual_kn-1010.pdf