From 39b508c0a0f23655af0bb75740fa9a376ad61284 Mon Sep 17 00:00:00 2001 From: Luke Thomas <96008479+Zoobdude@users.noreply.github.com> Date: Thu, 25 Apr 2024 11:02:15 +0000 Subject: [PATCH] add new features, most noteably edge redirect Co-authored-by: Yummy_Bacon5 --- edge_redirect.ini | 19 +++++++++++++++++++ main.ps1 | 47 ++++++++++++++++++++++++++--------------------- 2 files changed, 45 insertions(+), 21 deletions(-) create mode 100644 edge_redirect.ini diff --git a/edge_redirect.ini b/edge_redirect.ini new file mode 100644 index 0000000..e521afb --- /dev/null +++ b/edge_redirect.ini @@ -0,0 +1,19 @@ +[Config] +Managed=False +Mode=Service + +[Settings] +Edges=Stable,Beta,Dev,Canary +NoApps=True +NoBing=True +NoImgs=True +NoMSN=True +NoPDFs=False +NoTray=False +NoUpdates=True +Images=Google +News=DuckDuckGo +Search=Google +StartMenu=AppOnly +Startup=False +Weather=Darksky \ No newline at end of file diff --git a/main.ps1 b/main.ps1 index be3a59f..a0501ea 100644 --- a/main.ps1 +++ b/main.ps1 @@ -1,7 +1,13 @@ +#functions function UnPin-App { param( - [string]$appname - ) - ((New-Object -Com Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace("&","") -match "Unpin from taskbar"} | %{$_.DoIt()} + [string]$appname +) +try { + ((New-Object -Com Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace("&", "") -match "Unpin from taskbar"} | %{$_.DoIt()} + return "App '$appname' unpinned from Taskbar" +} catch { + Write-Error "Error Unpinning App! (App-Name correct?)" +} } UnPin-App "Microsoft Edge" @@ -13,34 +19,33 @@ Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Pe Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -Value 0 -Type Dword -Force # Remove task view -Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -Value 0 -Force +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Value 0 -Force + +# Hide desktop icons +Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideIcons" -Value 1 -Force +Stop-Process -processName: Explorer # Restart explorer to apply above two changes # Enable the clipboard history -Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Clipboard -Name EnableClipboardHistory -Value 1 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Clipboard" -Name EnableClipboardHistory -Value 1 # Set print screen to open snipping tool -Set-ItemProperty -Path HKCU:\Control Panel\Keyboard -Name PrintScreenKeyForSnippingEnabled -Value 1 -Type Dword +Set-ItemProperty -Path "HKCU:\Control Panel\Keyboard" -Name PrintScreenKeyForSnippingEnabled -Value 1 -Type Dword -# Change default browser to Chrome -$originalFile = "C:\Windows\System32\OEMDefaultAssociations.xml" -$content = Get-Content $originalFile +# Setup edge redirect - https://github.com/rcmaehl/MSEdgeRedirect/wiki/Deploying-MSEdgeRedirect +Invoke-WebRequest https://github.com/rcmaehl/MSEdgeRedirect/releases/latest/download/MSEdgeRedirect.exe -OutFile .\MSEdgeRedirect.exe +Start-Process MSEdgeRedirect.exe -ArgumentList "/silentinstall",".\edge_redirect.ini" -PassThru +Remove-Item -Path ".\MSEdgeRedirect.exe" -# Replace the Microsoft Edge associations with Google Chrome -$content = $content.Replace('', '') -$content = $content.Replace('', '') -$content = $content.Replace('', '') -$content = $content.Replace('', '') +# Close the trash browser :( +Stop-Process -Name msedge -Force Set-Content -Path $originalFile -Value $content # Open useful tabs -Start-Process "chrome.exe" "https://www.bbc.co.uk/news","--profile-directory="Default"" -Start-Process "chrome.exe" "https://github.com/login","--profile-directory="Default"" -Start-Process "chrome.exe" "https://teams.microsoft.com/","--profile-directory="Default"" -Start-Process "chrome.exe" "https://office.com","--profile-directory="Default"" - -# Close the trash browser -Stop-Process -Name msedge -Force +Start-Process "chrome.exe" "https://www.bbc.co.uk/news" +Start-Process "chrome.exe" "https://github.com/login" +Start-Process "chrome.exe" "https://teams.microsoft.com/" +Start-Process "chrome.exe" "https://office.com" # Easter egg ;)