If a cmdlet may require some time to save the configuration, then it may be helpful to know if the save operation has completed and if it was successful. You can get this information for the following Cmdlets:
Get-TPHubTaskResult [-TaskId] <string> [[-TimeOut] <timespan>] [-Proxy <string>]
|-TaskID||configuration specified by a variable.|
||ID of this task
saving process completed: True/False
save operation not successful: True/False
errors that may have occurred
|-TimeOut||Time how long to wait before performing the query.|
|-Proxy||• optional (from firmware version 1.1): proxy server address
• can also be specified globally using Set-TPHubProxy
The following example determines for Set-TPHubNetworkIPV4 whether the protocol has already been switched on and was successful.
$network = Get-TPHubNetworkIPV4 $network.DnsSrv2 = 126.96.36.199 $task = Set-TPHubNetworkIPV4 -Config $network Get-TPHubTaskResult -TaskId $task.TaskId
The following example determines for Set-TPHubEzeepCloudManagement if enabling cloud management of ezeep has already been completed and was successful.
$config = Get-TPHubEzeepCloudManagement $config.Enabled = 1 $task = Set-TPHubEzeepCloudManagement -Config $config Get-TPHubTaskResult -TaskId $task.TaskId
The following example determines for Import-TPHubBackup whether the restore of the backup has already been completed and was successful. Since it is not completed (HasCompleted = False) during the first query, the query is repeated a few seconds later.
$task = Import-TPHubBackup -Path "C:\ThinPrint Hub\hubbackup_2022-12-22.json" Get-TPHubTaskResult -TaskId $task.TaskId ... Get-TPHubTaskResult -TaskId $task.TaskId