Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,4 @@ function Set-DisabledScheduledTasks {
Disable-ScheduledTask -TaskPath "\Microsoft\Windows\Flighting\FeatureConfig\" -TaskName "UsageDataReporting" -ErrorAction SilentlyContinue
}

function Invoke-AllDebloatOptimizations {
Write-Host "Running debloat optimizations"
Set-ContentDelivery
Set-StorageSense
Set-DisableStorageSense
Set-DisabledScheduledTasks
}

Export-ModuleMember -Function Invoke-AllDebloatOptimizations
Export-ModuleMember -Function @()
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,4 @@ function Reset-PerformanceCounters {
winmgmt /resyncperf
}

function Invoke-AllMiscSystemUtilities {
Write-Host "Add-MusicVideosToHome"
Add-MusicVideosToHome
Write-Host "set time servers"
Set-TimeServers
Write-Host "Resetting performance counter"
Reset-PerformanceCounters
}

Export-ModuleMember -Function Invoke-AllMiscSystemUtilities
Export-ModuleMember -Function @()
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,4 @@ function Disable-SleepStudy {
schtasks /Change /TN "\Microsoft\Windows\Power Efficiency Diagnostics\AnalyzeSystem" /Disable
}

# Executes all optimizations in sequence
function Invoke-AllPerformanceOptimizations {
Write-Host "Optimizing NTFS"
Optimize-NTFS
Write-Host "disabling auto folder discovery"
Disable-AutoFolderDiscovery
Write-Host "disabling background apps"
Disable-BackgroundApps
Write-Host "disabling game bar"
Disable-GameBar
Write-Host "disabling sleep study"
Disable-SleepStudy
}

Export-ModuleMember -Function Invoke-AllPerformanceOptimizations
Export-ModuleMember -Function @()
Original file line number Diff line number Diff line change
Expand Up @@ -111,26 +111,4 @@ function Disable-UserActivityUpload {
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v "UploadUserActivities" /t REG_DWORD /d 0 /f
}

# Executes all privacy-related optimizations
function Invoke-AllPrivacyOptimizations {
Write-Host "Running privacy optimizations"
Disable-AdvertisingID
Disable-SyncProviderNotifications
Disable-NvidiaTelemetry
Disable-OfficeTelemetry
Disable-DeviceSetupSuggestions
Disable-NETCLITelemetry
Disable-InputTelemetry
Set-WindowsMediaPlayer
Disable-AppLaunchTracking
Disable-OnlineSpeechRecognition
Disable-UserActivityUpload
Set-SearchPrivacy
Disable-RecallSnapshots
Disable-TailoredExperiences
Disable-FrequentApps
Disable-LanguageListAccess
Disable-ErrorReporting
}

Export-ModuleMember -Function Invoke-AllPrivacyOptimizations
Export-ModuleMember -Function @()
Original file line number Diff line number Diff line change
Expand Up @@ -450,71 +450,4 @@ function Set-VisualEffects {
reg add "HKCU\SOFTWARE\Microsoft\Windows\DWM" /v "AlwaysHibernateThumbnails" /t REG_DWORD /d 0 /f
}

function Invoke-AllQolOptimizations {
Write-Host "Running QOL optimizations"
Set-AtlasTheme
Set-TooltipColorBlue
Disable-ThemeChangesToPersonalizedFeatures
Disable-ReadAndScan
Disable-AnnoyingFeaturesAndShortcuts
Disable-AccessibilityToolShortcut
Disable-EaseOfAccessSounds
Remove-ExtractFromContextMenu
Remove-PrintingFromContextMenus
Show-MoreDetailsOnTransfers
Set-SendToContextMenu
Disable-UseCheckBoxesToSelectItems
Hide-GalleryInFileExplorer
Disable-SearchingForInvalidShortcuts
Disable-NetworkNavigationPaneInExplorer
Hide-OfficeFilesInQuickAccess
Show-FullContextMenuOnItems
Hide-RecentItems
Set-MouseHoverTimeForItemInfo
Set-FileExplorerToThisPC
Remove-PreviousVersionsFromExplorer
Remove-ShortcutText
Show-AllFilesWithExtensions
Enable-CompactMode
Disable-ShowEdgeTabsInAltTab
Disable-AutoRun
Disable-AeroShake
Disable-LowDiskSpaceChecks
Disable-MenuHoverDelay
Disable-SharedExperiences
Disable-StartMenuRecommendations
Restore-OldContextMenu
Set-UnpinnedControlCenterItems
Show-MorePinsInStartMenu
Set-ShutdownTime
Disable-StartupDelay
Set-CloseApplicationsOnSessionEnd
Show-CommandPromptOnWinX
Disable-MicrosoftCopilot
Disable-ShowDesktopPeek
Hide-TabletMode
Disable-WindowsChat
Add-EndTaskToTaskbar
Disable-TaskViewOnTaskbar
Set-TaskbarAlignLeft
Add-NetworkSharingShortcut
Set-BootConfiguration
Disable-WallpaperCompression
Set-StartMenu
Set-WindowsInkWorkspace
Disable-AutomaticStoreAppArchiving
Disable-DynamicLighting
Disable-MouseAcceleration
Disable-ScreenCaptureHotkey
Disable-SpellChecking
Disable-UnnecessaryTouchKeyboardSettings
Disable-TouchVisualFeedback
Disable-WindowsFeedback
Disable-WindowsSpotlight
Disable-ReduceSoundsWhileInCall
Hide-DisabledAndDisconnectedDevicesInSoundsPanel
Set-VisualEffects
}

# Export functions for module
Export-ModuleMember -Function Invoke-AllQolOptimizations
Export-ModuleMember -Function @()
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,41 @@
# PowerShell Module for Executing System Scripts
# ==============================

Set-StrictMode -Version 3.0

# Backup Atlas Services and Drivers
$windir = $([Environment]::GetFolderPath('Windows'))
function Backup-AtlasServices {
$filePath = "$([Environment]::GetFolderPath('Windows'))\AtlasModules\Other\atlasServices.reg"
if (Test-Path $FilePath) { exit }
if (Test-Path $FilePath) { return }

$content = [System.Collections.Generic.List[string]]::new()
$content.Add("Windows Registry Editor Version 5.00")
Get-ChildItem "HKLM:\SYSTEM\CurrentControlSet\Services" | ForEach-Object {
try {
$values = Get-ItemProperty -Path $_.PSPath -Name 'Start', 'Description' -EA Stop
if ($values.Description -notmatch 'Windows Defender') {
$content.Add("`n[$($_.Name)]")
$content.Add('"Start"=dword:0000000' + $values.Start)
} else {
Write-Output "Excluding $($_.Name)..."
}
} catch {}
foreach ($serviceKey in (Get-ChildItem "HKLM:\SYSTEM\CurrentControlSet\Services")) {
$serviceProps = Get-ItemProperty -Path $serviceKey.PSPath -ErrorAction SilentlyContinue
if ($null -eq $serviceProps) {
continue
}

$startProperty = $serviceProps.PSObject.Properties['Start']
if ($null -eq $startProperty) {
continue
}
$startValue = $startProperty.Value

$description = $null
$descriptionProperty = $serviceProps.PSObject.Properties['Description']
if ($null -ne $descriptionProperty) {
$description = [string]$descriptionProperty.Value
}

if (($null -ne $description) -and ($description -match 'Windows Defender')) {
Write-Output "Excluding $($serviceKey.Name)..."
continue
}

$content.Add("`n[$($serviceKey.Name)]")
$content.Add('"Start"=dword:0000000' + $startValue)
}

# Set-Content can only do UTF8 with BOM, which doesn't work with reg.exe
Expand All @@ -40,10 +57,10 @@ function Update-ClientCBS {
$windir = [Environment]::GetFolderPath('Windows')
$settingsExtensions = (Get-ChildItem "$windir\SystemApps" -Recurse).FullName | Where-Object { $_ -like '*wsxpacks\Account\SettingsExtensions.json*' }
$arm = ((Get-CimInstance -Class Win32_ComputerSystem).SystemType -match 'ARM64') -or ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64')
if ($settingsExtensions.Count -eq 0) {
if (($null -eq $settingsExtensions) -or ($settingsExtensions.Count -eq 0)) {
Write-Output "Settings extensions ($settingsExtensions) not found."
Write-Output "User is likely on Windows 10, nothing to do. Exiting..."
exit
return
}

# Finds velocity IDs listed in 'Accounts' wsxpack
Expand Down Expand Up @@ -72,9 +89,9 @@ foreach ($settingsJson in $settingsExtensions) {
}

# No IDs check
if ($ids.Count -le 0) {
if (($null -eq $ids) -or ($ids.Count -le 0)) {
Write-Output "No velocity IDs were found. Exiting."
exit 1
throw "No velocity IDs were found."
}

# Hide 'Microsoft account' page in Settings that appears
Expand Down Expand Up @@ -176,7 +193,7 @@ function Disable-Mitigations {
function Optimize-PowerShellStartup {
# speeds up powershell startup time by 10x
$env:path = "$([Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory());" + $env:path
[AppDomain]::CurrentDomain.GetAssemblies().Location | ? {$_} | % {
[AppDomain]::CurrentDomain.GetAssemblies().Location | Where-Object { $_ } | ForEach-Object {
Write-Host "NGENing: $(Split-Path $_ -Leaf)" -ForegroundColor Yellow
ngen install $_ | Out-Null
}
Expand Down Expand Up @@ -242,4 +259,4 @@ function Invoke-AllSystemScripts {
Set-PowerSettings -DisablePowerSaving -DisableHibernation
}

Export-ModuleMember -Function Invoke-AllSystemScripts
Export-ModuleMember -Function Invoke-AllSystemScripts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Set-StrictMode -Version 3.0

$windir = [Environment]::GetFolderPath('Windows')

function Stop-ThemeProcesses {
Expand All @@ -11,7 +13,8 @@ function Set-Theme {
[string]$Path
)

if (!((Get-Item $Path -EA 0).Extension -eq '.theme')) {
$themeItem = Get-Item -Path $Path -ErrorAction SilentlyContinue
if (($null -eq $themeItem) -or ($themeItem.Extension -ne '.theme')) {
throw "'$Path' is not a valid path to a theme file."
}

Expand Down Expand Up @@ -111,7 +114,7 @@ function Set-LockscreenImage {
[Windows.System.UserProfile.LockScreen, Windows.System.UserProfile, ContentType = WindowsRuntime] | Out-Null

# setup async
$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? {
$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | Where-Object {
$_.Name -eq 'AsTask' -and
$_.GetParameters().Count -eq 1 -and
$_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1'
Expand All @@ -123,7 +126,7 @@ function Set-LockscreenImage {
$netTask.Result
}
Function AwaitAction($WinRtAction) {
$asTask = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and !$_.IsGenericMethod })[0]
$asTask = ([System.WindowsRuntimeSystemExtensions].GetMethods() | Where-Object { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and !$_.IsGenericMethod })[0]
$netTask = $asTask.Invoke($null, @($WinRtAction))
$netTask.Wait(-1) | Out-Null
}
Expand All @@ -139,4 +142,4 @@ function Set-LockscreenImage {
Remove-Item $newImagePath
}

Export-ModuleMember -Function Set-Theme, Set-ThemeMRU, Set-LockscreenImage
Export-ModuleMember -Function Set-Theme, Set-ThemeMRU, Set-LockscreenImage
Loading