|
############################ |
|
## pshell/magic start menu.ps1 |
|
########################### |
|
#Delete layout file if it already exists |
|
If(Test-Path C:\Windows\StartLayout.xml) |
|
{ |
|
Remove-Item C:\Windows\StartLayout.xml |
|
} |
|
|
|
#Creates the blank layout file |
|
echo "<LayoutModificationTemplate xmlns:defaultlayout=""http://schemas.microsoft.com/Start/2014/FullDefaultLayout"" xmlns:start=""http://schemas.microsoft.com/Start/2014/StartLayout"" Version=""1"" xmlns=""http://schemas.microsoft.com/Start/2014/LayoutModification"">" >> C:\Windows\StartLayout.xml |
|
echo " <LayoutOptions StartTileGroupCellWidth=""6"" />" >> C:\Windows\StartLayout.xml |
|
echo " <DefaultLayoutOverride>" >> C:\Windows\StartLayout.xml |
|
echo " <StartLayoutCollection>" >> C:\Windows\StartLayout.xml |
|
echo " <defaultlayout:StartLayout GroupCellWidth=""6"" />" >> C:\Windows\StartLayout.xml |
|
echo " </StartLayoutCollection>" >> C:\Windows\StartLayout.xml |
|
echo " </DefaultLayoutOverride>" >> C:\Windows\StartLayout.xml |
|
echo "</LayoutModificationTemplate>" >> C:\Windows\StartLayout.xml |
|
|
|
$regAliases = @("HKLM", "HKCU") |
|
|
|
#Assign the start layout and force it to apply with "LockedStartLayout" at both the machine and user level |
|
foreach ($regAlias in $regAliases){ |
|
$basePath = $regAlias + ":\SOFTWARE\Policies\Microsoft\Windows" |
|
$keyPath = $basePath + "\Explorer" |
|
IF(!(Test-Path -Path $keyPath)) { |
|
New-Item -Path $basePath -Name "Explorer" |
|
} |
|
Set-ItemProperty -Path $keyPath -Name "LockedStartLayout" -Value 1 |
|
Set-ItemProperty -Path $keyPath -Name "StartLayoutFile" -Value "C:\Windows\StartLayout.xml" |
|
} |
|
|
|
#Restart Explorer, open the start menu (necessary to load the new layout), and give it a few seconds to process |
|
Stop-Process -name explorer |
|
Start-Sleep -s 5 |
|
$wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('^{ESCAPE}') |
|
Start-Sleep -s 5 |
|
|
|
#Enable the ability to pin items again by disabling "LockedStartLayout" |
|
foreach ($regAlias in $regAliases){ |
|
$basePath = $regAlias + ":\SOFTWARE\Policies\Microsoft\Windows" |
|
$keyPath = $basePath + "\Explorer" |
|
Set-ItemProperty -Path $keyPath -Name "LockedStartLayout" -Value 0 |
|
} |
|
|
|
#Restart Explorer and delete the layout file |
|
Stop-Process -name explorer |
|
Remove-Item C:\Windows\StartLayout.xml |
|
|
|
|
|
############################ |
|
## pshell/onedrive.ps1 |
|
########################### |
|
cd C:\Windows\SysWOW64 |
|
.\OneDriveSetup.exe /uninstall |
|
|
|
############################ |
|
## pshell/printer autoinstall.ps1 |
|
########################### |
|
Function Stop-PrinterAutoInstall |
|
{ |
|
|
|
New-Item "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\NcdAutoSetup\Private" -Force | New-ItemProperty -Name "AutoSetup" -Value 0 -Force | Out-Null |
|
|
|
$PrinterInstall = Get-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\NcdAutoSetup\Private" -Name "AutoSetup" |
|
|
|
if ($PrinterInstall.AutoSetup -eq 0) |
|
{ |
|
Write-Host "Printer AutoSetup Disabled" |
|
} |
|
|
|
Else {Write-Host "Printer AutoSetup still enabled, please setup manually"} |
|
} |
|
|
|
|
|
Function Start-PrinterAutoInstall |
|
{ |
|
$PrinterInstall = Get-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\NcdAutoSetup\Private" -Name "AutoSetup" |
|
if ($PrinterInstall.AutoSetup -ne 1) |
|
{ |
|
Set-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\NcdAutoSetup\Private" -Name "AutoSetup" -Value 1 |
|
Write-Host "Printer AutoSetup enabled" |
|
} |
|
Else {Write-Host "Printer AutoSetup already Enabled"} |
|
} |
|
|
|
Stop-PrinterAutoInstall |
|
|
|
############################ |
|
## pshell/reg_system.ps1 |
|
########################### |
|
# disable all the ways MS can 'suggest' or show Candy Crush, etc in Start |
|
New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows -Name CloudContent |
|
Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent -Name DisableWindowsConsumerFeatures -Value 1 -Type DWord -Force |
|
Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Value 0 -Type DWord |
|
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SilentInstalledAppsEnabled -Value 0 -Type DWord |
|
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SystemPaneSuggestionsEnabled -Value 0 -Type DWord |
|
|
|
# Microsoft Edge harassment |
|
New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft -name "MicrosoftEdge" |
|
Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge -Name PreventFirstRunPage -Value 1 -Type DWord |
|
|
|
|
|
# Telemetry / customization of suggested apps |
|
Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Value 0 -Type DWord |
|
|
|
# automatically getting Windows Store Apps for printers and other dumb things |
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata" -Name "PreventDeviceMetadataFromNetwork" -Value 1 -Type Dword -Force |
|
|
|
# Timezone QOL |
|
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\TimeZoneInformation -Name RealTimeIsUniversal -Value 1 -Type QWord |
|
|
|
# "Finish setting up your device" every 3 days |
|
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\UserProfileEngagement -Name "ScoobeSystemSettingEnabled" -Value 0 -Type DWord -Force |
|
|
|
# News/Interests in taskbar |
|
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name "ShellFeedsTaskbarViewMode" -Value 2 -Type DWord -Force |
|
|
|
# Search highlights (cutesy icons) in taskbar search |
|
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows" -Name "Windows Search" |
|
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name EnableDynamicContentInWSB -Type DWord -Value 0 -Force |
|
|
|
|
|
############################ |
|
## pshell/reg_user.ps1 |
|
########################### |
|
# Driveby app install |
|
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SilentInstalledAppsEnabled -Value 0 -Type DWord |
|
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SystemPaneSuggestionsEnabled -Value 0 -Type DWord |
|
|
|
# "Finish setting up your device" |
|
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion -Name "UserProfileEngagement" |
|
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\UserProfileEngagement -Name "ScoobeSystemSettingEnabled" -Value 0 -Type DWord -Force |
|
|
|
# News/Interests in taskbar |
|
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name "ShellFeedsTaskbarViewMode" -Value 2 -Type DWord -Force |
|
|
|
|
|
############################ |
|
## pshell/remove some windows apps.ps1 |
|
########################### |
|
$appsToRemove = @( |
|
# These are the apps I remove. Delete lines if you want to keep these apps. |
|
# See the bottom of the script for more apps to remove if you want |
|
"Microsoft.3DBuilder", |
|
"Microsoft.Appconnector", |
|
"Microsoft.BingFinance", |
|
"Microsoft.BingNews", |
|
"Microsoft.BingWeather", |
|
"Microsoft.CommsPhone", |
|
"Microsoft.ConnectivityStore", |
|
"Microsoft.DesktopAppInstaller", |
|
"Microsoft.Getstarted", |
|
"Microsoft.Messaging", |
|
"Microsoft.Microsoft3DViewer", |
|
"Microsoft.MicrosoftOfficeHub", |
|
"Microsoft.MicrosoftStickyNotes", |
|
"Microsoft.MixedReality.Portal", |
|
"Microsoft.Office.OneNote", |
|
"Microsoft.Office.Sway", |
|
"Microsoft.OneConnect", |
|
"Microsoft.People", |
|
"Microsoft.SkypeApp", |
|
"Microsoft.MicrosoftSolitaireCollection", |
|
"Microsoft.StorePurchaseApp", |
|
"Microsoft.Wallet", |
|
"Microsoft.WindowsAlarms", |
|
"Microsoft.WindowsCamera", |
|
"microsoft.windowscommunicationsapps", |
|
"Microsoft.WindowsMaps", |
|
"Microsoft.WindowsPhone", |
|
"Microsoft.WindowsSoundRecorder", |
|
"Microsoft.YourPhone", |
|
# Here's more apps you may be interested in removing. Remove the first "#" to enable them. |
|
# |
|
# "Microsoft.MSPaint", # best dang thing ever |
|
# "Microsoft.ScreenSketch", # For taking screenshots mostly |
|
# "Microsoft.WindowsStore", # Windows Store: not recommended to remove |
|
# "Microsoft.Windows.Photos", # Actually useful for looking at folders of photos |
|
# |
|
# "Microsoft.Xbox.TCUI", # All of the Xbox stuff; don't remove if you use GamePass |
|
# "Microsoft.XboxApp", |
|
# "Microsoft.XboxGameOverlay", |
|
# "Microsoft.XboxGamingOverlay", |
|
# "Microsoft.XboxIdentityProvider", |
|
# "Microsoft.XboxSpeechToTextOverlay", |
|
# |
|
# "Microsoft.ZuneMusic", # Groove Music |
|
# "Microsoft.ZuneVideo", # Movie Player, pretty dang useful |
|
"This.Line.Is.Ignored" |
|
) |
|
|
|
Get-AppxProvisionedPackage -Online | % { if($_.DisplayName -in $appsToRemove){ echo $_.PackageName; Remove-AppxPackage -AllUsers $_.PackageName } } |