Skip to content

Instantly share code, notes, and snippets.

@mwallner
Last active July 30, 2023 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwallner/be6f6db6f9cfe36af7618920bb14b932 to your computer and use it in GitHub Desktop.
Save mwallner/be6f6db6f9cfe36af7618920bb14b932 to your computer and use it in GitHub Desktop.
psconfeu23_hostsetup
# NuGet package provider. Do this early as reboots are required
if (-not (Get-PackageProvider -Name NuGet -ErrorAction SilentlyContinue)) {
Write-Host "Install-PackageProvider"
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Scope AllUsers -Confirm:$False
# Exit equivalent
Invoke-Reboot
}
# Install initial version of PowerShellGet
if (-not (Get-InstalledModule -Name PowerShellGet -ErrorAction SilentlyContinue)) {
Write-Host "Install-Module PowerShellGet"
Install-Module -Name "PowerShellGet" -AllowClobber -Force -Scope AllUsers
# Exit equivalent
Invoke-Reboot
}
# thanks but no thanks
Get-AppxPackage Facebook.Facebook | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage TuneIn.TuneInRadio | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage Microsoft.MinecraftUWP | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage Microsoft.MicrosoftSolitaireCollection | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage KeeperSecurityInc.Keeper | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage 2FE3CB00.PicsArt-PhotoStudio | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage 9E2F88E3.Twitter | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name *Twitter | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name *MarchofEmpires | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name king.com.* | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.3DBuilder | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name *Bing* | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.Office.Word | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.Office.PowerPoint | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.Office.Excel | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.MicrosoftOfficeHub | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name DellInc.PartnerPromo | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.Office.OneNote | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.MicrosoftSolitaireCollection | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.SkypeApp | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.YourPhone | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name *XBox* | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.MixedReality.Portal | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.Microsoft3DViewer | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name SpotifyAB.SpotifyMusic | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUser -Name Microsoft.MSPaint | Remove-AppxPackage -ErrorAction SilentlyContinue # Paint3D
# sofware - general
cinst firefox
cinst 7zip
cinst paint.net
cinst FiraCode
cinst windirstat
# software - dev
cinst git
cinst rocolatey
cinst vscode
cinst vscode-powershell
<#
$licenseDir = Join-Path $env:chocolateyInstall 'license'
$licenseFile = Join-Path $licenseDir 'chocolatey.license.xml'
if (-Not (Test-Path $licenseDir)) {
New-Item -type directory -path $licenseDir | Out-Null
}
if (-Not (Test-Path $licenseFile)) {
$c4bLicense = 'https://gist.githubusercontent.com/mwallner/e32606bbddcd7535793c9a2253a6abbc/raw/8190d38149fe729fb62c1df81e0e0763dceb90f2/chocolatey.license.xml'
Invoke-WebRequest -URI $c4bLicense -OutFile $licenseFile
}
choco upgrade chocolatey.extension
choco sync
#>
#PowerShell help
Update-Help -ErrorAction SilentlyContinue
Update-ExecutionPolicy RemoteSigned
Disable-GameBarTips
Disable-BingSearch
Set-WindowsExplorerOptions -EnableShowFileExtensions -EnableExpandToOpenFolder
Set-BoxstarterTaskbarOptions -Size Small
Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol
# Install-WindowsUpdate -AcceptEula -GetUpdatesFromMS
# avoid name clash:
Boxstarter.WinConfig\Install-WindowsUpdate -GetUpdatesFromMS -AcceptEula
Enable-UAC