Skip to content

Commit

Permalink
Merge pull request #235 from silversword411/main
Browse files Browse the repository at this point in the history
New Community Script: Reboot
  • Loading branch information
silversword411 committed Jun 4, 2024
2 parents 87cff55 + 83b637b commit 8ee1fe4
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
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
}

0 comments on commit 8ee1fe4

Please sign in to comment.