Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Community Script: Reboot #235

Merged
merged 4 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions community_scripts.json
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,20 @@
],
"default_timeout": 30
},
{
"guid": "5bc815a0-d349-416f-8c3d-ac499d4da2e8",
"filename": "Win_Reboot.ps1",
"submittedBy": "https://github.com/silversword411",
"name": "Reboot/Restart Computer",
"description": "Reboots/Restarts the computer with an optional wait time before restarting.",
"syntax": "[-wait <Int>]",
"shell": "powershell",
"category": "TRMM (Win):Other",
"supported_platforms": [
"windows"
],
"default_timeout": 86400
},
{
"guid": "f396dae2-c768-45c5-bd6c-176e56ed3614",
"filename": "Win_Power_RestartorShutdown.ps1",
Expand Down
28 changes: 28 additions & 0 deletions scripts/Win_Reboot.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<#
.SYNOPSIS
Reboots/Restarts the computer with an optional wait time before restarting. Max wait 24hrs

.DESCRIPTION
This script restarts the computer forcefully.

.PARAMETER Wait
Specifies the number of seconds to wait before restarting the computer.

.EXAMPLE
-Wait 60
Waits for 60 seconds and then restarts the computer.

.NOTES
v1.0 5/17/2024 Created by silversword411 and dinger1986
#>

param(
[int]$Wait
)

if ($Wait) {
shutdown -r -t $Wait
}
else {
Restart-Computer -Force
}
Loading