Powershell ISE PSSession disconnect freezes ISE?

Chris Steinheiser 0 Reputation points
2020-12-09T15:53:16.277+00:00

Using Powershell ISE I start a PSSession to a windows 2016 Server. I change the IP settings. when the IP address is updated Powershell ISE/PSSession is disconnected.
I get:
WARNING: The netwrok connection to x.x.x.x has been interrupted. Attmpting to reconnect for up to 4 minutes . . .

Then
WARNING: Computer x.x.x.x has been successfully disconnected.

However at this point Powershell ISE Is frozen.

How disconnect the PSSession at the time or before the network disconnect?
How to terminate the PSSession so it doesn't freeze PS ISE?

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 47,906 Reputation points
    2020-12-09T21:03:59.063+00:00

    Don't change the IP address, add a second IP address to the NIC. Disconnect from the PSSession and connect to the new IP address. Now you can remove the first IP address from the NIC leaving only the one you added.

    If you change the only IP address on the NIC you're going to be disconnected. How the ISE handles that I don't know, but apparently it's not handled well.

    Don't forget that if you're changing IP addresses you may have to wait for DNS or NetBIOS updates. A better way is to use DHCP and reserved addresses. If DHCP, DNS, WINS (if you still use that) and the client machine are configured properly your changes happen automatically the next time the client refreshes their lease and your IP assignments are documented.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.