Fabian Hagedorn
Fabian Hagedorn

Reputation: 11

Resume in PowerShell 5.1 if exe doesn't finish

I am using a loop (ForEach-Object) in a PowerShell script to connect to different hosts via plink (PuTTY).

plink -ssh $_ -l $user -pw $password -T -batch $command

$_ is the IP address of the host.

The command does an upgrade on the remote host. After the upgrade, the remote host reboots, but the connection doesn't close. So plink/PowerShell waits endlessly. How can I get PowerShell to resume the script?

Upvotes: 1

Views: 57

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202504


You will find dozens of other questions here for both approaches.

Upvotes: 1

Related Questions