Update Script.ps1

master
Chris Nutter 2023-09-19 11:52:21 -07:00
parent c4d26f5714
commit 4eab65f15f
1 changed files with 11 additions and 9 deletions

View File

@ -1,3 +1,12 @@
# Check if running with elevated privileges
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "Please run this script as an administrator."
Exit
}
# Enable ping (ICMP Echo) requests
New-NetFirewallRule -DisplayName "Allow ICMP Echo Request" -Protocol ICMPv4 -IcmpType 8 -Enabled True
# Turn on Dark Mode
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0 -PropertyType DWORD -Force
@ -26,16 +35,9 @@ $ScreenConnectPath = "$env:TEMP\ScreenConnect.ClientSetup.exe"
Invoke-WebRequest -Uri $ScreenConnectUrl -OutFile $ScreenConnectPath
Start-Process -FilePath $ScreenConnectPath -ArgumentList "/silent" -Wait
# Install Discord
$discordURL = "https://discordapp.com/api/download?platform=win"
$discordPath = "$env:USERPROFILE\Downloads\discord-setup.exe"
Invoke-WebRequest -Uri $discordURL -OutFile $discordPath
Start-Process -FilePath $discordPath -Wait
# Run commands in new PowerShell instance
Start-Process powershell.exe -ArgumentList "-NoProfile -Command {irm https://massgrave.dev/get | iex}"
Start-Process powershell.exe -ArgumentList "-NoProfile -Command {iwr -useb https://christitus.com/win | iex}"
# Start-Process powershell.exe -ArgumentList "-NoProfile -Command {irm https://massgrave.dev/get | iex}"
# Start-Process powershell.exe -ArgumentList "-NoProfile -Command {iwr -useb https://christitus.com/win | iex}"
# Disable sleep and enable high performance mode
powercfg -change -standby-timeout-ac 0