Skip to content

Instantly share code, notes, and snippets.

@sudmed
Created September 30, 2019 16:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sudmed/728207af6350c0fb75e7596b4bb414a2 to your computer and use it in GitHub Desktop.
Save sudmed/728207af6350c0fb75e7596b4bb414a2 to your computer and use it in GitHub Desktop.
#############################
##### Magic script v1.01 ####
#############################
# Ask for elevated permissions if required
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) {
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
Exit
}
# Boxstarter options
Import-Module Boxstarter.Chocolatey
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
#$cred=Get-Credential Admin
Update-ExecutionPolicy Unrestricted
mkdir C:\Temp
###chocolatey core.extension needed for pyton3###
choco upgrade chocolatey-core.extension -y -s \\192.168.1.15\distros$\choco
###Open Shell (только модуль для кнопки Start)###
choco upgrade open-shell -installArgs ADDLOCAL=StartMenu -y -s "\\192.168.1.15\distros$\choco\"
Write-Warning "Open-Shell installed"
### Microsoft .NET Framework 4.8.0.0 ###
choco upgrade chocolatey-dotnetfx.extension -y
choco upgrade kb2919355 -y
choco upgrade dotnetfx -y -s "\\192.168.1.15\distros$\choco\"
Write-Warning "Microsoft .NET Framework installed"
#write-host 'COMPUTERNAME'
#$input = Read-Host "ENTER NEW COMPUTERNAME like YNDX-MB-01"
#Rename-Computer -newname "$input"
#Write-Warning 'COMPUTERNAME DONE!'
write-host 'USERNAME'
$input2 = Read-Host "ENTER USERNAME like user214-1"
$input3 = Read-Host "ENTER PASSWORD"
copy-item "\\192.168.1.15\distros$\choco\autologon\*" C:\Temp
$autologon = "C:\Temp\Autologon.exe"
$username = "$input2"
$domain = "AD"
$password = "$input3"
Start-Process $autologon -ArgumentList "/accepteula", $username, $domain, $password -Wait
Write-Warning 'USERNAME DONE!'
if (Test-PendingReboot) { Invoke-Reboot }
# Uninstall McAfee Security App
cmd /c "echo Uninstalling w/o Chocolatey"
write-host "McAfee Security App"
$mcafee = gci "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" | foreach { gp $_.PSPath } | ? { $_ -match "McAfee Security" } | select UninstallString
if ($mcafee) {
$mcafee = $mcafee.UninstallString -Replace "C:\Program Files\McAfee\MSC\mcuihost.exe",""
Write "Uninstalling McAfee..."
start-process "C:\Program Files\McAfee\MSC\mcuihost.exe" -arg "$mcafee" -Wait
}
Write-Warning "McAfee uninstalled"
cmd /c "timeout /t 5 /nobreak"
### Uninstall McAfee WebAdvisor ###
write-host "Uninstall McAfee WebAdvisor"
start-process "C:\Program Files\McAfee\WebAdvisor\Uninstaller.exe" -arg "/s" -Wait
Write-Warning "McAfee WebAdvisor uninstalled"
### Uninstall McAfee Security ###
write-host "Uninstall McAfee Security"
start-process "C:\Program Files\McAfee\MSC\mcuihost.exe" -arg "/body:misp://MSCJsRes.dll::uninstall.html /id:uninstall" -Wait
Write-Warning "McAfee Security uninstalled"
# Uninstall with McAfee Removal Tool (mcpr)
#cmd /c "echo Installing w/o Chocolatey"
#write-host 'McAfee Removal Tool'
#copy-item "\\192.168.1.15\distros$\choco\McAfee_uninst\MCPR.exe" C:\Temp
#start-process "C:\Temp\MCPR.exe" -Wait
#Write-Warning "McAfee totaly removed"
if (Test-PendingReboot) { Invoke-Reboot }
### VS 2017 community ###
cmd /c "echo Installing w/o Chocolatey"
write-host "VS 2017 community"
certutil.exe -addstore -f "Root" "\\192.168.1.15\distros$\choco\VS2017offline\certificates\manifestRootCertificate.cer"
certutil.exe -addstore -f "Root" "\\192.168.1.15\distros$\choco\VS2017offline\certificates\manifestCounterSignRootCertificate.cer"
certutil.exe -addstore -f "Root" "\\192.168.1.15\distros$\choco\VS2017offline\certificates\vs_installer_opc.RootCertificate.cer"
start-process "\\192.168.1.15\distros$\choco\VS2017offline\vs_Community_2017_Ru.exe" -Argumentlist "--add Microsoft.VisualStudio.Workload.Universal;includeRecommended --add Microsoft.VisualStudio.Workload.ManagedDesktop;includeRecommended --add Microsoft.VisualStudio.Workload.NativeDesktop;includeRecommended --add Microsoft.VisualStudio.Workload.NetCoreTools;includeRecommended --add Microsoft.VisualStudio.Workload.Data;includeRecommended --add Microsoft.VisualStudio.Workload.NetWeb;includeRecommended --add Microsoft.VisualStudio.Workload.Node;includeRecommended --add Microsoft.VisualStudio.Workload.VisualStudioExtension;includeRecommended -p --wait --norestart --noWeb" -Wait
Write-Warning "VS 2017 community installed"
if (Test-PendingReboot) { Invoke-Reboot }
#Winconfig
write-host "Winconfig"
Disable-InternetExplorerESC
Disable-BingSearch
Disable-GameBarTips
#Disable-UAC
cmd /c "timeout /t 5 /nobreak"
#WindowsExplorerOptions
write-host "WindowsExplorerOptions"
Set-WindowsExplorerOptions -EnableShowFileExtensions -EnableExpandToOpenFolder -DisableOpenFileExplorerToQuickAccess -DisableShowRecentFilesInQuickAccess -DisableShowHiddenFilesFoldersDrives -DisableShowFrequentFoldersInQuickAccess
Write-Warning "WindowsExplorerOptions DONE!"
#power-config
write-host "Power config"
Powercfg -h off
#powershell -Command "Start-Process 'powercfg.exe' -Verb runAs -ArgumentList '/h off'"
#Powercfg /Change -disk-timeout-ac 60
#Powercfg /Change -disk-timeout-dc 60
#Powercfg /Change -monitor-timeout-ac 45
#Powercfg /Change -monitor-timeout-dc 45
#Powercfg /Change standby-timeout-ac 0
#Powercfg /Change hibernate-timeout-ac 0
Write-Warning "Power config DONE!"
# Show taskbar buttons on taskbar where window is open
write-host "Show taskbar buttons on taskbar where window is open"
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2
Write-Warning "Show taskbar buttons on taskbar where window is open DONE!"
# Hide taskbar search box
write-host 'Hide taskbar search box'
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Search -Name SearchboxTaskbarMode -Value 0
Write-Warning "Hide taskbar search box DONE!"
# Hide taskbar task view button
write-host "Hide taskbar task view button"
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -Value 0
Write-Warning "Hide taskbar task view button DONE!"
# Hide Windows Ink Workspace button
write-host 'Hide Windows Ink Workspace button'
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PenWorkspace -Name PenWorkspaceButtonDesiredVisibility -Value 0
Write-Warning 'Hide Windows Ink Workspace button DONE!'
# Disable 'Let apps use advertising ID'
write-host 'Disable Let apps use advertising ID'
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Value 0
Write-Warning 'Disable Let apps use advertising ID DONE!'
# Disable 'Show me suggested content in the Settings app'
write-host 'Disable Show me suggested content in the Settings app'
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338393Enabled -Value 0
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-353694Enabled -Value 0
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-353696Enabled -Value 0
Write-Warning 'Disable Show me suggested content in the Settings app DONE!'
# Disable 'Occasionally show suggestions in Start'
write-host 'Disable Occasionally show suggestions in Start'
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338388Enabled -Value 0
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SystemPaneSuggestionsEnabled -Value 0
Write-Warning 'Disable Occasionally show suggestions in Start DONE!'
# Disable 'Show me the Windows welcome experience after updates and occasionally when I sign in to highlight what’s new and suggested'
write-host 'Disable Show me the Windows welcome experience after updates'
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-310093Enabled -Value 0
Write-Warning 'Disable Show me the Windows welcome experience after updates DONE!'
# Disable 'Get tips, tricks, and suggestions as you use Windows'
write-host 'Disable Get tips, tricks, and suggestions as you use Windows'
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338389Enabled -Value 0
Write-Warning 'Disable Get tips, tricks, and suggestions as you use Windows DONE!'
# Stop default apps from coming back
write-host 'Stop default apps from coming back'
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name OemPreInstalledAppsEnabled -Value 0
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name PreInstalledAppsEnabled -Value 0
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name PreInstalledAppsEverEnabled -Value 0
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SilentInstalledAppsEnabled -Value 0
Write-Warning 'Stop default apps from coming back DONE!'
# Clean up the programs list
# See Remove default Apps from Windows 10 https://thomas.vanhoutte.be/miniblog/delete-windows-10-apps/
# See Debloat Windows 10 https://github.com/W4RH4WK/Debloat-Windows-10
# Command line to list all packages: Get-AppxPackage -AllUsers | Select Name, PackageFullName
write-host 'Remove unwanted Store apps'
Get-AppxPackage -AllUsers -Name *GeForce Experience* | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers -Name *McAfee* | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers -Name *OneDrive* | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage *Dropbox* | Remove-AppxPackage
Get-AppxPackage -AllUsers -Name *Dropbox* | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers Facebook.Facebook | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers TuneIn.TuneInRadio | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers Microsoft.MinecraftUWP | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers Microsoft.MicrosoftSolitaireCollection | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers KeeperSecurityInc.Keeper | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers *PicsArt-PhotoStudio | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers Twitter | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers -Name *Twitter | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers -Name *MarchofEmpires | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers -Name king.com.* | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers -Name Microsoft.3DBuilder | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage -AllUsers -Name *Bing* | Remove-AppxPackage -ErrorAction SilentlyContinue
#Get-AppxPackage Microsoft.Windows.ParentalControls | Remove-AppxPackage
Get-AppxPackage -AllUsers Windows.ContactSupport | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.Xbox* | Remove-AppxPackage
Get-AppxPackage -AllUsers microsoft.windowscommunicationsapps | Remove-AppxPackage # Mail and Calendar
#Get-AppxPackage -AllUsers Microsoft.Windows.Photos | Remove-AppxPackage
#Get-AppxPackage -AllUsers Microsoft.WindowsCamera | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.SkypeApp | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.Zune* | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.WindowsPhone | Remove-AppxPackage # Phone Companion
Get-AppxPackage -AllUsers Microsoft.WindowsMaps | Remove-AppxPackage
#Get-AppxPackage -AllUsers Microsoft.Office.OneNote | Remove-AppxPackage
#Get-AppxPackage -AllUsers Microsoft.Office.Sway | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.Appconnector | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.WindowsFeedback* | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.Windows.FeatureOnDemand.InsiderHub | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.Windows.Cortana | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.People | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.Bing* | Remove-AppxPackage # Money, Sports, News, Finance and Weather
Get-AppxPackage -AllUsers Microsoft.Getstarted | Remove-AppxPackage
#Get-AppxPackage -AllUsers Microsoft.MicrosoftOfficeHub | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.MicrosoftSolitaireCollection | Remove-AppxPackage
#Get-AppxPackage -AllUsers Microsoft.WindowsSoundRecorder | Remove-AppxPackage
#Get-AppxPackage -AllUsers Microsoft.3DBuilder | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.Messaging | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.CommsPhone | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.Advertising.Xaml | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.Windows.SecondaryTileExperience | Remove-AppxPackage
#Get-AppxPackage -AllUsers Microsoft.Windows.ParentalControls | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.Windows.ContentDeliveryManager | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.Windows.CloudExperienceHost | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.Windows.ShellExperienceHost | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.BioEnrollment | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.OneConnect | Remove-AppxPackage
Get-AppxPackage -AllUsers *Twitter* | Remove-AppxPackage
Get-AppxPackage -AllUsers king.com.CandyCrushSodaSaga | Remove-AppxPackage
Get-AppxPackage -AllUsers flaregamesGmbH.RoyalRevolt2 | Remove-AppxPackage
Get-AppxPackage -AllUsers *Netflix | Remove-AppxPackage
Get-AppxPackage -AllUsers Facebook.Facebook | Remove-AppxPackage
Get-AppxPackage -AllUsers Microsoft.MinecraftUWP | Remove-AppxPackage
Get-AppxPackage -AllUsers *MarchofEmpires | Remove-AppxPackage
Write-Warning 'Remove unwanted Store apps DONE!'
# See How to Completely Uninstall OneDrive in Windows 10 http://lifehacker.com/how-to-completely-uninstall-onedrive-in-windows-10-1725363532
write-host 'Uninstalling OneDrive'
cmd /c "taskkill /f /im OneDrive.exe"
cmd /c "C:\Windows\SysWOW64\OneDriveSetup.exe /uninstall"
Write-Warning 'Uninstalling OneDrive DONE!'
cmd /c "timeout /t 7 /nobreak"
# Disable Quick Access: Recent Files
write-host 'Disable Quick Access: Recent Files'
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -Type DWord -Value 0
# To Restore: Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -Type DWord -Value 1
Write-Warning 'Disable Quick Access: Recent Files DONE'
# Disable Quick Access: Frequent Folders
write-host 'Disable Quick Access: Frequent Folders'
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowFrequent -Type DWord -Value 0
# To Restore: Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowFrequent -Type DWord -Value 1
Write-Warning 'Disable Quick Access: Frequent Folders DONE!'
### Disable publisher verification ('The Publisher could not be verified. Are you sure you want to run this software?')
### (to restore defaults do: reg import "\\192.168.1.15\distros$\choco\disable_publisher_verification\restore_defaults.reg")
write-host 'Disable publisher verification'
& reg import "\\192.168.1.15\distros$\choco\disable_publisher_verification\disable publisher verification.reg"
Write-Warning "Publisher verification disabled"
if (Test-PendingReboot) { Invoke-Reboot }
#PascalABCNET 3.5.0
cmd /c "echo Installing w/o Chocolatey"
write-host 'PascalABCNET'
mkdir D:\PascalABCNET
& "\\192.168.1.15\distros$\choco\PascalABCNET\install.cmd"
Write-Warning 'PascalABCNET installed'
# Kumir 1.9 + Kumir 2.1
cmd /c "echo Installing w/o Chocolatey"
write-host 'Kumir 1.9 & Kumir 2.1'
& "\\192.168.1.15\distros$\choco\Kumir\install.cmd"
Write-Warning 'Kumir 1.9 & Kumir 2.1 installed'
# Adobe Reader 11.0.23
cmd /c "echo Installing w/o Chocolatey"
write-host 'Adobe Reader'
& "\\192.168.1.15\distros$\choco\AdobeReader\install.cmd"
Write-Warning 'Adobe Reader installed'
# 7zip 19.0
write-host '7zip'
choco upgrade 7zip.install -y -s "\\192.168.1.15\distros$\choco\"
Write-Warning '7zip installed'
# Far 3.0.5454
write-host 'Far'
choco upgrade far -y -s "\\192.168.1.15\distros$\choco\"
Write-Warning 'Far installed'
# Notepad++ 7.1.1
write-host 'Notepad++'
choco upgrade notepadplusplus.install -y -s "\\192.168.1.15\distros$\choco\"
Write-Warning 'Notepad++ installed'
# Google Chrome 77.0.3865.75
write-host 'Google Chrome'
choco upgrade googlechrome -y -s "\\192.168.1.15\distros$\choco\"
Write-Warning 'Google Chrome installed'
### Pyton 3.7.0###
write-host 'Pyton'
choco upgrade python3 --version 3.7.0 --params "/InstallDir:C:\Python37" -y -s \\192.168.1.15\distros$\choco
Write-Warning 'Pyton installed'
if (Test-PendingReboot) { Invoke-Reboot }
### Python upgrade pip###
write-host 'Pyton upgrade pip'
cmd /c "cd /d C:\Python37"
cmd /c "python -m pip install --upgrade pip"
cmd /c "TIMEOUT /T 5"
cmd /c "python -m pip install numpy scipy matplotlib ipython jupyter sympy pandas"
python -m pip list
cmd "/c TIMEOUT /T 10"
Write-Warning 'Pyton pip upgraded'
### Codeblocks 17.12###
write-host 'Codeblocks'
mkdir D:\codeblocks
choco upgrade codeblocks -y -s \\192.168.1.15\distros$\choco
cmd /c START "\\192.168.1.15\distros$\choco\!scripts\codeblocks_rus.cmd"
Write-Warning 'Codeblocks installed'
### PyCharm CommunityEdition 2019.2.2###
write-host 'PyCharm Community Edition'
choco upgrade pycharm-community -y -s \\192.168.1.15\distros$\choco
cmd /c START "\\192.168.1.15\distros$\choco\!scripts\pycharm_settings.cmd"
#copy-item "\\192.168.1.15\distros$\choco\pycharm_settings\PyCharm_settings.zip" "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2019.2.2\"
Write-Warning 'PyCharm Community Edition installed'
### Wing IDE 101 7.1.1###
write-host 'Wing IDE 101'
choco upgrade wingide101 -y -s \\192.168.1.15\distros$\choco
Write-Warning 'Wing IDE 101 installed'
### Freepascal 3.0.4###
write-host 'Freepascal'
choco upgrade freepascal -y -s \\192.168.1.15\distros$\choco
Write-Warning 'Freepascal installed'
### Blender 2.80###
write-host 'Blender'
choco install vcredist2008 -y -s \\192.168.1.15\distros$\choco
choco upgrade blender -y -s \\192.168.1.15\distros$\choco
Write-Warning 'Blender installed'
### Paint.NET 4.2.4###
write-host 'Paint.NET'
choco upgrade paint.net -y #-s \\192.168.1.15\distros$\choco
Write-Warning 'Paint.NET installed'
### Audacity 2.3.2###
write-host 'Audacity'
choco upgrade audacity -y -s \\192.168.1.15\distros$\choco
Write-Warning 'Audacity installed'
###LAME for Audacity 3.100.0.20190331###
write-host 'LAME for Audacity'
choco upgrade audacity-lame -y -s \\192.168.1.15\distros$\choco
Write-Warning 'LAME for Audacity installed'
###FFmpeg for Audacity 2.2.2.20181007###
write-host 'FFmpeg for Audacity'
choco upgrade audacity-ffmpeg -y -s \\192.168.1.15\distros$\choco
Write-Warning 'FFmpeg for Audacity installed'
### LibreOffice Fresh 6.3.2###
#choco upgrade libreoffice-fresh -y -s \\192.168.1.15\distros$\choco #--ignorechecksum
cmd /c "echo Installing w/o Chocolatey"
write-host 'LibreOffice Fresh'
copy-item "\\192.168.1.15\distros$\choco\libre-office\LibreOffice_6.3.2_Win_x86.msi" C:\Temp
start-process "C:\Temp\LibreOffice_6.3.2_Win_x86.msi" -Argumentlist "/quiet /norestart" -Wait
Write-Warning 'LibreOffice Fresh installed'
### GIMP 2.10.12 ###
cmd /c "echo Installing w/o Chocolatey"
write-host 'GIMP'
copy-item "\\192.168.1.15\distros$\choco\gimp\gimp.exe" C:\Temp
start-process "C:\Temp\gimp.exe" -Argumentlist "/VERYSILENT /NORESTART" -Wait
Write-Warning 'GIMP installed'
### Adobe AIR Runtime 32.0.0.125 ###
write-host "Adobe AIR"
choco upgrade adobeair -y -s \\192.168.1.15\distros$\choco
Write-Warning "Adobe AIR installed"
### Scratch 3.6.0 ###
cmd /c "echo Installing w/o Chocolatey"
write-host 'Scratch'
copy-item "\\192.168.1.15\distros$\choco\scratch\Scratch.exe" C:\Temp
start-process "C:\Temp\Scratch.exe" -Argumentlist "/allusers /S" -Wait
Write-Warning "Scratch installed"
### Skype 8.52.0.138 ###
write-host "Skype"
choco upgrade skype -y -s \\192.168.1.15\distros$\choco
Write-Warning "Skype installed"
### Openshot 2.4.4 ###
write-host "OpenShot"
choco upgrade openshot -y -s \\192.168.1.15\distros$\choco
Write-Warning "Openshot installed"
### Flash Player PPAPI 32.0.0.255 ###
write-host "Flash Player PPAPI"
choco upgrade flashplayerppapi -y -s \\192.168.1.15\distros$\choco
Write-Warning "Flash Player PPAPI installed"
### Flash Player Plugin 32.0.0.255 ###
write-host "Flash Player Plugin"
choco upgrade flashplayerplugin -y -s \\192.168.1.15\distros$\choco
Write-Warning "Flash Player Plugin installed"
### Java SE Runtime Environment 8.0.221 ###
write-host "Java SE Runtime Environment"
choco upgrade jre8 -y -s \\192.168.1.15\distros$\choco
Write-Warning "Java SE Runtime Environment installed"
### Microsoft Silverlight 5.1.50918.00.0 ###
write-host "Microsoft Silverlight"
choco upgrade silverlight -y -s \\192.168.1.15\distros$\choco
Write-Warning "Microsoft Silverlight installed"
### Inkscape 0.92.4.20190121 ###
write-host "Inkscape"
choco upgrade inkscape -y -s \\192.168.1.15\distros$\choco
Write-Warning "Inkscape installed"
### DesktopOK 6.59 ###
#write-host "DesktopOK"
#choco upgrade desktopok -y -s \\192.168.1.15\distros$\choco
#Write-Warning "DesktopOK installed"
#Enable-MicrosoftUpdate
#Install-WindowsUpdate -acceptEula -SuppressReboots
if (Test-PendingReboot) { Invoke-Reboot }
#dfmirage
#cmd /c "echo Installing w/o Chocolatey"
#write-host 'dfmirage driver'
#mkdir C:\Temp
#copy-item "\\192.168.1.15\distros$\deploy\dfmirage_driver\dfmirage-setup-2.0.301.exe" C:\Temp
#start-process "C:\Temp\dfmirage-setup-2.0.301.exe" -Argumentlist "/verysilent /norestart" -Wait
#Write-Warning 'dfmirage driver installed'
### Veyon 4.2.5 ###
write-host "Veyon"
copy-item "\\192.168.1.15\distros$\choco\veyon\veyon-mobile.json" C:\Temp
copy-item "\\192.168.1.15\distros$\choco\veyon\uninstall_veyon.cmd" C:\Temp
cmd /c "C:\Temp\uninstall_veyon.cmd"
choco upgrade veyon --params '"/config:C:\Temp\veyon-mobile.json"' -y -s \\192.168.1.15\distros$\choco
xcopy "\\192.168.1.15\distros$\choco\veyon\key" "C:\ProgramData\Veyon\keys\public\KK\"
Write-Warning "Veyon installed"
# Remove GeForce Experience tool
write-host 'Remove GeForce Experience tool'
#copy-item "\\192.168.1.15\distros$\choco\DDU\" C:\Temp -recurse
#start-process "C:\Temp\DDU\Display Driver Uninstaller.exe" -Argumentlist "-silent -nosafemodemsg -createsystemrestorepoint -preventwinupdate -RemoveGFE -restart" -Wait
start-process "C:\Windows\SysWOW64\RunDll32.EXE" -Argumentlist '"C:\Program Files\NVIDIA Corporation\Installer2\InstallerCore\NVI2.DLL",UninstallPackage Display.GFExperience -silent' -Wait
Write-Warning 'GeForce Experience has already been uninstalled!'
# Remove desktop shortcuts
write-host 'Remove desktop shortcuts for user “$input2”'
del C:\Users\"$input2"\Desktop\*.lnk
del C:\Users\admin.AD\Desktop\*.lnk
del C:\Users\Public\Desktop\*.lnk
Write-Warning 'Remove desktop shortcuts DONE!'
# Copy desktop shortcuts
write-host 'Copy desktop shortcuts'
copy-item "\\192.168.1.15\distros$\choco\shortcuts\*" C:\Users\Public\Desktop\
Write-Warning 'Copying desktop shortcuts DONE!'
# Range desktop shortcuts
write-host 'Range desktop shortcuts'
start-process "\\192.168.1.15\distros$\choco\ReIcon\ReIcon_x64.exe" -Argumentlist "/R /File \\192.168.1.15\distros$\choco\ReIcon\YNDX-214_IconLayouts.ini /Name YNDX-214 /ID ari" -Wait
Write-Warning "Range desktop shortcuts DONE!"
write-host "enable-UAC"
enable-UAC
Write-Warning "UAC enabled"
if (Test-PendingReboot) { Invoke-Reboot }
# Cleanup
write-host "Cleanup"
Remove-Item "C:\Temp\*" -Force -Recurse
& reg import "\\192.168.1.15\distros$\choco\cleanmgr\cleanmgr_settings.reg"
Start-Process -FilePath CleanMgr.exe -ArgumentList "/sagerun:214" -Wait
#HKLM\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization
Write-Warning "Cleanup DONE!"
# Restrict Windows Update P2P
Write-Host "Restricting Windows Update P2P"
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" -Name "DODownloadMode" -Type DWord -Value 0
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization")) {
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization" | Out-Null
}
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode" -Type DWord -Value 0
Write-Warning "Restrict Windows Update P2P DONE!"
# Unrestrict Windows Update P2P
# Remove-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode"
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode"
# Disable Windows Update automatic restart
#Write-Host "Disable Windows Update automatic restart"
#Write-Host "Disabling Windows Update automatic restart..."
#Set-ItemProperty -Path "HKLM:\Software\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 1
#Write-Warning "Disable Windows Update automatic restart"
# Enable Windows Update automatic restart
# Set-ItemProperty -Path "HKLM:\Software\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 0
# Show Computer shortcut on desktop
Write-Host "Showing Computer shortcut on desktop..."
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu")) {
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" | Out-Null
}
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -Type DWord -Value 0
Write-Warning "Show Computer shortcut on desktop DONE!"
# Hide Computer shortcut from desktop
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
### Restore publisher verification (The Publisher could not be verified. Are you sure you want to run this software?) ###
cmd /c "echo Installing w/o Chocolatey"
write-host "Restore publisher verification"
& reg import "\\192.168.1.15\distros$\choco\disable_publisher_verification\restore defaults.reg"
Write-Warning "Restore publisher verification DONE!"
### Disable wifi & bluetooth ###
Disable-NetAdapter -Name "Беспроводная сеть" -Confirm:$false
Disable-NetAdapter -Name "Сетевое подключение Bluetooth" -Confirm:$false
#Reboot
cmd /c "echo Let's reboot"
#if (Test-PendingReboot) { Invoke-Reboot }
Restart-Computer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment