---
title: "Restart Server"
---
Restarts a server and waits for it to become available again.
Restart-Server(
[After: <integer>],
[MinimumDelay: <integer>]
);
This operation may be prefixed with BuildMaster::
, although this is a built-in namespace and isn't really necessary.
Name | Format | Script Usage | Usage Notes |
---|---|---|---|
Restart after | integer | After | Value note: "default (immediately)". |
Minimum reconnect wait | integer | MinimumDelay | Value note: "default (15 seconds)". |
Note: The After and MinimumDelay properties are advanced options, and determine how many seconds to wait before the operating system shutdown is initiated (default and minimum value is 5), and how many seconds to wait until attempting to reconnect to the agent (default and minimum value is 15). These generally should be kept at defaults, unless the server takes an extraordinary time to shutdown.
Note: If the server is used by another operation before this operation completes, then the results are undefined.
# restart the current server after 10 seconds
Restart-Server(
After: 10
);