mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 19:35:49 +00:00
add deps and ready check
This commit is contained in:
parent
e51980dc0c
commit
941ebd6adf
6 changed files with 712 additions and 0 deletions
36
scripts/optimize.ps1
Normal file
36
scripts/optimize.ps1
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# Set Power Plan to High Performance and disable sleep
|
||||
Write-Output "Configuring Power Plan to High Performance and disabling sleep..."
|
||||
slmgr /rearm
|
||||
powercfg -setactive SCHEME_MIN
|
||||
powercfg /x -hibernate-timeout-ac 0
|
||||
powercfg /x -hibernate-timeout-dc 0
|
||||
powercfg /x -disk-timeout-ac 0
|
||||
powercfg /x -disk-timeout-dc 0
|
||||
powercfg /x -monitor-timeout-ac 0
|
||||
powercfg /x -monitor-timeout-dc 0
|
||||
powercfg /x -standby-timeout-ac 0
|
||||
powercfg /x -standby-timeout-dc 0
|
||||
|
||||
# Disable Windows Search Indexing (optional, for minimal interruption)
|
||||
Write-Output "Disabling Windows Search indexing service..."
|
||||
Stop-Service -Name "WSearch" -Force -ErrorAction SilentlyContinue
|
||||
Set-Service -Name "WSearch" -StartupType Disabled
|
||||
|
||||
# Set Network Adapters to not enter Power Saving mode
|
||||
Write-Output "Disabling Power Saving for Network Adapters..."
|
||||
Get-WmiObject -Namespace root\wmi -Class MSPower_DeviceEnable -Filter "InstanceName LIKE 'PCI\\\\VEN%'" | ForEach-Object {
|
||||
$_.Enable = $false
|
||||
$_.Put()
|
||||
}
|
||||
|
||||
# Set Firewall to allow all connections (optional; adjust based on your requirements)
|
||||
Write-Output "Configuring Windows Firewall to allow all connections (if necessary)..."
|
||||
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
|
||||
netsh advfirewall set allprofiles state off
|
||||
|
||||
# This can't be done inside provision script, because a restart is needed for changes to take effect.
|
||||
Write-Host "Enable IPv6"
|
||||
reg add hklm\system\currentcontrolset\services\tcpip6\parameters /f /v DisabledComponents /t REG_DWORD /d 0
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue