ToolboxSession Module
The ToolboxSession module enables to interface with the Crestron devices via the Crestron Toolbox COM server.
The following cmdlets are available for the ToolboxSession module:
- Open-ToolboxSession
- Invoke-ToolboxSession
- Close-ToolboxSession
For example:
Use the following syntax to obtain the device version, firmware version, and check the firmware version against a passed in parameter:
$s = Open-ToolboxSession 'tcp CP3-7F123456'
$x = Invoke-ToolboxSession $s 'ProductRefreshInfo'
Invoke-ToolboxSession $s 'FirmwareUpdate "\\crestdata2a\pro2_4.008.0013.zip"'
$x = Invoke-ToolboxSession $s 'FirmwareGetDeviceVer'
$x = Invoke-ToolboxSession $s 'FirmwareCheckDeviceVer "1.009.0012"'
Close-ToolboxSession $s
NOTES:
- The quotes ('' and "") allow embedding a string as a parameter in the command string.
- The open function requires a Crestron Toolbox type address. If it is not specified, USB is used by default.
The Crestron Toolbox slot or a Cresnet® network paradigm is used to address devices in the hierarchical chain.
For example:
Use the following syntax to retrieve the version and update the firmware on a Cresnet device:
$f = 'R:\Cameo\c2n-cbd_series_1.003.0038.zip'
$s = Open-ToolboxSession 'ssh CP3-7F123456:cresnet 25'
Invoke-ToolboxSession $s 'ProductRefreshInfo' -Timeout 30
Invoke-ToolboxSession $s "FirmwareUpdate `"$f`"" -Timeout 120
Close-ToolboxSession $s
The open cmdlet supports an optional parameter that logs all the console transactions including the date and time stamp to a specified log file.
For example:
Use the following syntax to log all the console transactions:
$s = Open-ToolboxSession 'tcp CP3-7F123456' -ConsoleLog 'C:\Logs\MyLog.txt'
Invoke-ToolboxSession $s 'GeneralCommEcho False'
Invoke-ToolboxSession $s 'ReportHardware'
Close-ToolboxSession $s