Restart-AdsComputer

SYNOPSIS

Restarts ("reboots") the operating system on local and remote TwinCAT computers.

SYNTAX

NetIdPort (Default)

Restart-AdsComputer [-Wait] [-WaitTimeout <Int32>] [-Delay <Int32>] [[-NetId] <AmsNetId[]>] [-Timeout <Int32>]
 [-Quiet] [-WhatIf] [-Confirm] [<CommonParameters>]

Route

Restart-AdsComputer [-Wait] [-WaitTimeout <Int32>] [-Delay <Int32>] [-InputObject] <IRoute[]>
 [-Timeout <Int32>] [-Quiet] [-WhatIf] [-Confirm] [<CommonParameters>]

AddressStr

Restart-AdsComputer [-Wait] [-WaitTimeout <Int32>] [-Delay <Int32>] [-Address] <String[]> [-Timeout <Int32>]
 [-Quiet] [-WhatIf] [-Confirm] [<CommonParameters>]

Session

Restart-AdsComputer [-Wait] [-WaitTimeout <Int32>] [-Delay <Int32>] -Session <ISession[]> [-Timeout <Int32>]
 [-Quiet] [-WhatIf] [-Confirm] [<CommonParameters>]

SessionId

Restart-AdsComputer [-Wait] [-WaitTimeout <Int32>] [-Delay <Int32>] -SessionId <Int32[]> [-Timeout <Int32>]
 [-Quiet] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

The Restart-AdsComputer cmdlet restarts the operating system on the local and remote TwinCAT computers. You can use the parameters of Restart-AdsComputer to specify available ADS target systems to restart. The restart can be done delayed if Users are logged into the target system (existant Session UI) or forced immediatly. You can wait for the restart to complete before you run the next command and specify a waiting time-out. This feature makes it practical to use Restart-AdsComputer in scripts and functions.

EXAMPLES

Example 1

PS> Restart-AdsComputer CX_1111,CX_2222 -force

Restarts the computers CX_1111 and CX_2222 immediatly without warning logged in users on the target system and returns immediatly without waiting the finished reboot. The Force parameter supresses the ShouldProcess query.

Example 2

PS> Restart-AdsComputer -netId '1.2.3.4.1.1', '1.2.3.5.1.1' -Delay 30 -Wait -WaitTimeout 240 -force

Restarts the TwinCAT targets '1.2.3.4.1.1' and 1.2.3.5.1.1' without ShouldProcess query after a delay of 30 Seconds (if a user is logged in) and waits for the reboot before continuing. The Wait timeout is set to 240 Seconds.

PARAMETERS

-Wait

Activates a wait until the rebooted system is available again. The parameter -WaitTimeout specifies how long the script waits for the reboot.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-WaitTimeout

This parameter sets, how long the Restart-AdsComputer cmdlet is waiting for the reboot of the target system in seconds (Default: 300 seconds / 5 Minutes). This gives the system some time to process any outstanding Operating System Updates. This parameter is only used when the -Wait parameter is set. The Wait Timeout in Seconds.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: 300
Accept pipeline input: False
Accept wildcard characters: False

-Delay

The delay time for the reboot/shutdown of the target system(s) in seconds. The default is 0 Seconds (staring immediatly). If no user is logged in the target system the reboot/shutdown occurs always immediatly without warning. In case of a log in, a Warning message with countdown for the delay seconds will be presented to the user. The Delay before Shutdown/Reboot in Seconds.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-NetId

NetId(s) of the target system. Tab completion: Completes AmsNetId values from currently reachable routes on the local TwinCAT system. The NetId(s) of the addressed Systems.

Type: AmsNetId[]
Parameter Sets: NetIdPort
Aliases:

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

-InputObject

The ADS routes to shutdown/reboot. Tab completion: Completes route names from currently reachable ADS systems on the local TwinCAT system. The AdsRoutes to process within this Cmdlet.

Type: IRoute[]
Parameter Sets: Route
Aliases: Destination, Route

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Address

Target names/addresses. These can consist of RouteName, NetID, HostName or IPAddress. This parameter supports wildcards. Tab completion: Completes route names from currently reachable ADS systems on the local TwinCAT system. The address(es).

Type: String[]
Parameter Sets: AddressStr
Aliases: Name

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

-Session

The Session(s) to use for addressing the target systems. The Session(s).

Type: ISession[]
Parameter Sets: Session
Aliases:

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

-SessionId

Specifies the Sessions (with unique ID) to use for addressing the target systems. Tab completion: Completes IDs of active TwinCAT sessions (created with New-TcSession). The SessionId(s)

Type: Int32[]
Parameter Sets: SessionId
Aliases:

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

-Timeout

The communication ADS timeout in milliseconds. A value of 0 disables the timeout. A value <= 0 sets the Default (5000 ms). The ADS communication timeout in milliseconds.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: -1
Accept pipeline input: False
Accept wildcard characters: False

-Quiet

The Quiet parameter suppresses the 'ShouldProcess' messsage and the Cmdlet will be processed without further user confirmation.. Value of the Quiet parameter

Type: SwitchParameter
Parameter Sets: (All)
Aliases: Silent

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
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

TwinCAT.IRoute[]

TwinCAT.ISession[]

OUTPUTS

NOTES