# Start logging Start-Transcript -Path "$env:USERPROFILE\Documents\setup-log.txt" # Set execution policy to unrestricted Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force # Install PowerShellGet and PSReadLine Install-Module -Name PowerShellGet -Force Install-Module -Name PSReadLine -AllowPrerelease -Force -Confirm:$false # Set PSReadLine options Set-PSReadLineOption -PredictionSource History Set-PSReadLineOption -PredictionViewStyle ListView # Enable File Extensions Display Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Value 0 # Set Explorer to open to This PC Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Value 1 # Install WSL and Ubuntu Distro wsl --install wsl --set-version Ubuntu 2 # Check if AutoHotKey is installed through winget $ahkInstalled = $(winget list | Select-String -Pattern "AutoHotkey") # Compile the AutoHotKey script if installed if ($ahkInstalled) { $ahkCompilerPath = "C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" if (Test-Path $ahkCompilerPath) { Start-Process $ahkCompilerPath -ArgumentList "/in $env:USERPROFILE\Documents\shortcuts.ahk /out $env:USERPROFILE\Documents\shortcuts.exe" } else { Write-Host "Ahk2Exe.exe not found. Skipping AutoHotKey script compilation." } } # Move the compiled AutoHotkey executable to the Startup folder Copy-Item -Path "$env:USERPROFILE\Documents\shortcuts.exe" -Destination "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup" # Remove AutoHotkey script and compiled executable from Documents Remove-Item -Path "$env:USERPROFILE\Documents\shortcuts.ahk" -Force Remove-Item -Path "$env:USERPROFILE\Documents\shortcuts.exe" -Force # Install PowerShell 7 profile $psProfileUrl = "https://gist.githubusercontent.com/aaxyat/d8b1405d9b83b2973ffdec665ebec55b/raw/434f01ba90704157553faa2add2af20232fc071c/Microsoft.PowerShell_profile.ps1" $psProfilePath = "$env:USERPROFILE\Documents\PowerShell 7\Microsoft.PowerShell_profile.ps1" if (-Not (Test-Path "$env:USERPROFILE\Documents\PowerShell 7")) { New-Item -ItemType Directory -Path "$env:USERPROFILE\Documents\PowerShell 7" } Invoke-WebRequest -Uri $psProfileUrl -OutFile $psProfilePath # Install Windows Terminal profile $wtProfileUrl = "https://gist.githubusercontent.com/aaxyat/2d988708e412dbf7f553bec580ea81a9/raw/03462babd371879db0cd1cfddf8cb07f838b0982/settings.json" $wtProfilePath = "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json" if (-Not (Test-Path "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState")) { New-Item -ItemType Directory -Path "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState" } Invoke-WebRequest -Uri $wtProfileUrl -OutFile $wtProfilePath # Install Starship.toml $starshipTomlUrl = "https://gist.githubusercontent.com/aaxyat/0918cf52a83461290547fe4beedf28df/raw/7d94a67b90b51170760568290bdd655ba48f9ff8/starship.toml" $starshipTomlPath = "$env:USERPROFILE\.config\starship.toml" if (-Not (Test-Path "$env:USERPROFILE\.config")) { New-Item -ItemType Directory -Path "$env:USERPROFILE\.config" } Invoke-WebRequest -Uri $starshipTomlUrl -OutFile $starshipTomlPath Write-Host "Script execution completed successfully!" Read-Host "Press Enter to exit..." # Stop logging Stop-Transcript