From 4eab65f15fe3535cec31c8ccd697c824ff0c5519 Mon Sep 17 00:00:00 2001 From: Chris Nutter Date: Tue, 19 Sep 2023 11:52:21 -0700 Subject: [PATCH] Update Script.ps1 --- Script.ps1 | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Script.ps1 b/Script.ps1 index f8939f5..ae79d08 100644 --- a/Script.ps1 +++ b/Script.ps1 @@ -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