diff --git a/.gitignore b/.gitignore index a5307ee..12f9c20 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ Vagrant/.vagrant/* -Vagrant/vagrant_build.log +Vagrant/vagrant*.log Packer/packer_cache/* Packer/packer_build.log Boxes/* diff --git a/Packer/scripts/MakeWindows10GreatAgain.ps1 b/Packer/scripts/MakeWindows10GreatAgain.ps1 index 8706268..16313f1 100644 --- a/Packer/scripts/MakeWindows10GreatAgain.ps1 +++ b/Packer/scripts/MakeWindows10GreatAgain.ps1 @@ -3,10 +3,6 @@ Write-Host "Making Windows 10 Great again" Write-Host "Importing registry keys..." regedit /s a:\MakeWindows10GreatAgain.reg -# Install Powershell Help items -Write-Host "Updating Powershell Help Library..." -Update-Help - # Remove OneDrive from the System Write-Host "Removing OneDrive..." $onedrive = Get-Process onedrive -ErrorAction SilentlyContinue @@ -14,3 +10,11 @@ if ($onedrive) { taskkill /f /im OneDrive.exe } c:\Windows\SysWOW64\OneDriveSetup.exe /uninstall + +Update-Help -Force -ErrorAction SilentlyContinue + +# Remove Microsoft Store and Edge shortcuts from the taskbar +$appname = "Microsoft Edge" +((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace('&','') -match 'Unpin from taskbar'} | %{$_.DoIt(); $exec = $true} +$appname = "Microsoft Store" +((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace('&','') -match 'Unpin from taskbar'} | %{$_.DoIt(); $exec = $true} diff --git a/Packer/scripts/MakeWindows10GreatAgain.reg b/Packer/scripts/MakeWindows10GreatAgain.reg index 503d399..e8ed2d4 100644 --- a/Packer/scripts/MakeWindows10GreatAgain.reg +++ b/Packer/scripts/MakeWindows10GreatAgain.reg @@ -36,10 +36,14 @@ Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel] "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"=dword:00000000 - + [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu] "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"=dword:00000000 # Enable Developer Mode (prerequisite for Linux subsystem) [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock] "AllowDevelopmentWithoutDevLicense"=dword:00000001 + +# Disable Microsoft People icon from taskbar +[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People] +"PeopleBand"=dword:00000000 diff --git a/Packer/scripts/debloat-windows.ps1 b/Packer/scripts/debloat-windows.ps1 index 686943c..bae63da 100755 --- a/Packer/scripts/debloat-windows.ps1 +++ b/Packer/scripts/debloat-windows.ps1 @@ -14,9 +14,6 @@ if ($env:PACKER_BUILDER_TYPE -And $($env:PACKER_BUILDER_TYPE).startsWith("hyperv #. $env:TEMP\Debloat-Windows-10-master\scripts\block-telemetry.ps1 #Write-Host Disable services #. $env:TEMP\Debloat-Windows-10-master\scripts\disable-services.ps1 - Write-host Disable Windows Defender - #. $env:TEMP\Debloat-Windows-10-master\scripts\disable-windows-defender.ps1 - Uninstall-WindowsFeature Windows-Defender-Features Write-host Optimize Windows Update . $env:TEMP\Debloat-Windows-10-master\scripts\optimize-windows-update.ps1 #Write-host Disable Windows Update diff --git a/Packer/scripts/enable-winrm.ps1 b/Packer/scripts/enable-winrm.ps1 index c0c7587..b294cd3 100755 --- a/Packer/scripts/enable-winrm.ps1 +++ b/Packer/scripts/enable-winrm.ps1 @@ -9,5 +9,6 @@ winrm set winrm/config/client/auth '@{Basic="true"}' winrm set winrm/config/listener?Address=*+Transport=HTTP '@{Port="5985"}' netsh advfirewall firewall set rule group="Windows Remote Administration" new enable=yes netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" new enable=yes action=allow -Set-Service winrm -startuptype "auto" +sc config winrm start= disabled +reg add HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce /v StartWinRM /t REG_SZ /f /d "cmd.exe /c 'sc config winrm start= auto & sc start winrm'" Restart-Service winrm diff --git a/Packer/scripts/vm-guest-tools.bat b/Packer/scripts/vm-guest-tools.bat index cd33b74..137d4da 100755 --- a/Packer/scripts/vm-guest-tools.bat +++ b/Packer/scripts/vm-guest-tools.bat @@ -1,6 +1,9 @@ if not exist "C:\Windows\Temp\7z920-x64.msi" ( powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://www.7-zip.org/a/7z920-x64.msi', 'C:\Windows\Temp\7z920-x64.msi')" &2 "Attempting to bring up the $HOST host using Vagrant") cd "$DL_DIR"/Vagrant || exit 1 - VAGRANT_LOG=info $(which vagrant) up "$HOST" --provider="$PROVIDER" 3>&1 1>&2 2>&3 | tee -a "$DL_DIR/Vagrant/vagrant_build.log" + $(which vagrant) up "$HOST" --provider="$PROVIDER" 2> "$DL_DIR/Vagrant/vagrant_up_$HOST.log" echo "$?" } @@ -373,6 +373,7 @@ choose_md5_tool() { # Downloads pre-built Packer boxes from detectionlab.network to save time during CI builds download_boxes() { + choose_md5_tool if [ "$PROVIDER" == "virtualbox" ]; then wget "https://www.detectionlab.network/windows_2016_virtualbox.box" -O "$DL_DIR"/Boxes/windows_2016_virtualbox.box wget "https://www.detectionlab.network/windows_10_virtualbox.box" -O "$DL_DIR"/Boxes/windows_10_virtualbox.box