Notes on Windows 11

I've finally upgraded to Windows 11. In this blog I'll add some tuning I've applied to my installs (both private and for the company).

Remove Bing Search from the start menu

Inspired by this blog, this script will remove Bing Search from the Windows 11 start menu:

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name BingSearchEnabled -Value 0 -Type DWord

Stop-Process -Name explorer -Force
Start-Process explorer.exe

Restore the Explorer "old" context menu

Inspired by this blog, we can restore the Windows 10 Explorer context menu:

$path = "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32"

if (-not (Test-Path $path)) {
    New-Item -Path $path -Force
}

Set-ItemProperty -Path $path -Name "(Default)" -Value ""

Stop-Process -Name explorer -Force
Start-Process explorer.exe

Restore file extensions in Explorer

The following script will enable the visibility of file extensions in Windows Explorer:

Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name HideFileExt -Value 0

Stop-Process -Name explorer
Start-Process explorer.exe

Enable Hyper-V management

I use Docker / WSL a lot, so I need some extra features to manage them:

# Check if running with Administrator privileges
if (([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    # Enable Hyper-V, Hyper-V Management Tools, and Hyper-V Platform
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Management-PowerShell
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Management-Clients
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Services
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Platform

    # Check if a restart is needed
    if ((Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V).State -ne 'Enabled') {
        $restartConfirmation = Read-Host "A restart is required to complete the installation. Do you want to restart now? (Y/N)"
        if ($restartConfirmation -eq 'Y' -or $restartConfirmation -eq 'y') {
            Restart-Computer
        } else {
            Write-Host "Please remember to restart your computer to complete the Hyper-V installation."
        }
    }
} else {
    Write-Host "This script requires Administrator privileges."
    Write-Host "Please run the PowerShell as an Administrator."
}

PowerShell 7 Core

I'm using Chocolatey as my installer of choice. Let's use it to install Powershell Core.

choco install powershell-core

Now that PowerShell is installed, you'll need to set it to default in your Windows Terminal settings:

Edit the settings.
Pick the dark PowerShell logo at the bottom.

Better wallpaper

To have more controls over the look and feel of Windows 11, install Dynamic Theme by Christophe Lavalle from the Windows Store. It will give you the pictures from the Bing and Windows Spotlight sources.

Further reading

While working on this blog, I found the following articles which might be of service:

Changelog

expand_less