diff --git a/src/playbook/Configuration/tweaks.yml b/src/playbook/Configuration/tweaks.yml index 8a78403797..f22cc11dc0 100644 --- a/src/playbook/Configuration/tweaks.yml +++ b/src/playbook/Configuration/tweaks.yml @@ -290,8 +290,7 @@ tasks: # ----------------------------------------------------- - tweaks\statuses\status-security.yml - tweaks\security\block-anonymous-enum-sam.yml - # This account should be deleted after OOBE - # - tweaks\security\delete-defaultuser0.yml + - tweaks\security\delete-defaultuser0.yml - tweaks\security\disable-remote-assistance.yml # Not needed on modern versions of Windows # https://learn.microsoft.com/en-us/dotnet/framework/network-programming/tls diff --git a/src/playbook/Executables/CLEANUP.ps1 b/src/playbook/Executables/CLEANUP.ps1 index 73a5bad27f..3f337f9be8 100644 --- a/src/playbook/Executables/CLEANUP.ps1 +++ b/src/playbook/Executables/CLEANUP.ps1 @@ -1,4 +1,5 @@ # AtlasOS Post-Installation Cleanup Utility +$ErrorActionPreference = 'SilentlyContinue' # As cleanmgr has multiple processes, there's no point in making the window hidden as it won't apply function Invoke-AtlasDiskCleanup { @@ -52,13 +53,13 @@ foreach ($drive in $drives) { if (!($otherInstalls)) { Invoke-AtlasDiskCleanup } # Clear the temporary user folder -Get-ChildItem -Path "$env:TEMP" -File | Remove-Item -Force -EA SilentlyContinue +Get-ChildItem -Path "$env:TEMP" -File | Remove-Item -Force # Exclude the AME folder while deleting directories in the temporary user folder -Get-ChildItem -Path "$env:TEMP" -Directory | Where-Object { $_.Name -ne 'AME' } | Remove-Item -Force -Recurse -EA SilentlyContinue +Get-ChildItem -Path "$env:TEMP" -Directory | Where-Object { $_.Name -ne 'AME' } | Remove-Item -Force -Recurse # Clear the temporary system folder -Remove-Item -Path "$env:windir\Temp\*" -Force -Recurse -EA SilentlyContinue +Remove-Item -Path "$env:windir\Temp\*" -Force -Recurse # Disable Reserved Storage for updates Set-WindowsReservedStorageState -State Disabled @@ -67,7 +68,7 @@ Set-WindowsReservedStorageState -State Disabled vssadmin delete shadows /all /quiet # Clear Event Logs -wevtutil el 2>$null | ForEach-Object {wevtutil cl "$_"} 2>$null +wevtutil el | ForEach-Object {wevtutil cl "$_"} Stop-Service -Name "dps" -Force Stop-Service -Name "wuauserv" -Force