-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmariah.ps1
48 lines (40 loc) · 1.66 KB
/
mariah.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
##################################################################
# Mariah.ps1
# self-elevates to admin
# disables keys & mouse
# turns volume up to 100
# plays Mariah Carey All I Want For Xmas Is You looped for 8 hours
# merry Xmas
# Fritz R. 24.11.2023
##################################################################
### Self-elevate the script if required
If (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
If ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) {
$CommandLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine
Exit
}
}
### Disable user input
$code = @"
[DllImport("user32.dll")]
public static extern bool BlockInput(bool fBlockIt);
"@
$userInput = Add-Type -MemberDefinition $code -Name UserInput -Namespace UserInput -PassThru
Function Disable-UserInput($seconds) {
$userInput::BlockInput($true)
Start-Sleep $seconds
$userInput::BlockInput($false)
}
### Turn volume up
Function Set-Speaker($Volume)
{
$wshShell = new-object -com wscript.shell;1..50 | % {$wshShell.SendKeys([char]174)};1..$Volume | % {$wshShell.SendKeys([char]175)}
}
### Main
Set-Speaker -Volume 100
# Youtube version
# Start-Process "https://www.youtube.com/watch?v=aAkMkVFwAoo?autoplay=1&loop=1"
# Spotify version
Start-Process "https://open.spotify.com/intl-de/track/0bYg9bo50gSsH3LtXe2SQn?si=d5d7eb8a91ed408a"
Disable-UserInput -seconds 28800 | Out-Null