Format-TpmsDispatch

42 views 0

Description

Defines the format of PowerShell’s information output.

Syntax

Format-TpmsDispatch [-Input <psobject[]>]
Parameter Description
-Input result variable, examples:

$results or ($results)

-Consume result variable

$true = with pipelining, all further objects aren’t be forwarded

Example 1: cmdlet usage

Start-TpmsSetupByAgent -Servers ($server) | Format-TpmsDispatch

Example 2: cmdlet usage

$results = Start-TpmsSetupByAgent -Servers ($server)

Format-TpmsDispatch -Input ($results)

Example 3: Script containing Format-TpmsDispatch

The following script can be run on an admin computer to initiate the Tpms environment. The script must run only once per session. It imports the module Tpms.Powershell, sets the URL of Tpms.Service and sets the log level to Info, defines a target server ($srv2) running Tpms.Agent (cps47.ourdomain.local) and – finally – sends the relevant calls to the target machine with Start-TpmsSetupByAgent -Servers ($srv2). The output layout is set by Format-TpmsDispatch.

Set-TpmsServiceUrl -Uri https://tpms035.ourdomain.local:4040

Set-TpmsLogLevel -RelayLogLevel Info

$srv2 = New-TpmsObjSetupAgent -Name "cps47.ourdomain.local" -Port 5050 -Credential (Get-Credential -Message "Please enter your credentials." -UserName "ourdomain\Administrator")

Start-TpmsSetupByAgent -Servers ($srv2) | Format-TpmsDispatch

Without Format-TpmsDispatch the output is shown in a classic layout.

Tpms.Powershell: output in a classic layout

In contrast, with Format-TpmsDispatch the same output is shown in – a shorter – table form.

Tpms.Powershell: output in table form using Format-TpmsDispatch

Previous Page
Next Page

Was this helpful?