Skip to content

Instantly share code, notes, and snippets.

@NBprojekt
Last active May 20, 2021 09:18
Show Gist options
  • Save NBprojekt/e78bc463dee9c85d49d99e85c43fa411 to your computer and use it in GitHub Desktop.
Save NBprojekt/e78bc463dee9c85d49d99e85c43fa411 to your computer and use it in GitHub Desktop.
# This command may be required before executing the script
#Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine -Force;
# Logs are placed on the current users desktop
Start-Transcript -Path "~/Desktop/install.log";
# Install Chocolatey
$chocoVersion = powershell choco -v;
if(-not($chocoVersion)) {
Write-Output "Seems Chocolatey is not installed, installing now";
Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'));
} else{
Write-Output "Chocolatey Version $chocoVersion is already installed";
}
# Disable features
Write-Host "Disable unneeded features:"
Disable-WindowsOptionalFeature -FeatureName Internet-Explorer-Optional-amd64 –Online -NoRestart; # IE
Write-Host "Internet explorer: " (&{If($?) {"disabled"} Else {"failed"}});
Get-AppxPackage -allusers Microsoft.549981C3F5F10 | Remove-AppxPackage; # Cortana
Write-Host "Cortana: " (&{If($?) {"disabled"} Else {"failed"}});
# Packages
Write-Host "Installing packages:"
choco install googlechrome -y;
#choco install firefox -y;
choco install steam-client -y;
choco install 7zip -y;
choco install adobereader -y;
# End logs and restart
Write-Host "Restarting after log ends";
Write-Host "Done.";
Stop-Transcript;
Restart-Computer -Force;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment