[PowerShell] Sophia Script for Windows 10 & Windows 11 | 5.17.8 | 6.5.8 | x64 2023

Discussion in 'Scripting' started by farag, May 8, 2020.

  1. drew84

    drew84 MDL Expert

    Mar 13, 2014
    1,347
    2,302
    60
    Just to help out

    29.06.2020
    released this 17 hours ago

    Windows 10 2004 | 1903/1909 Version
    Diff from v4.5.3 (Windows 10 2004)
    4.5.3...4.5.4
    Diff from v4.4.3 (Windows 10 1903/1909)
    4.4.3...4.4.4

    Updated
    • Updated "Turn off Cortana autostarting" section
    • Updated "Create "Process Creation" Event Viewer Custom View" section
    • Removed "Uninstall all Xbox related UWP apps from all accounts" section because it's unnecassary
    • Closed #36
      • Removed "Show accent color on Start, taskbar, and action center" section
      • Show accent color on the title bars and window borders
    • Comments;
    • Minor changes
     
  2. oldee

    oldee MDL Member

    May 27, 2012
    171
    47
    10
    @farag, Please post latest updated script to the first page for convenience to tracking with change log.
    Thank you.
     
  3. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
    Done.
     
  4. MARKZ1ON

    MARKZ1ON MDL Junior Member

    May 22, 2020
    59
    3
    0
    hope this works for LTSC 1809 :)
     
  5. drew84

    drew84 MDL Expert

    Mar 13, 2014
    1,347
    2,302
    60
    I would read the documentation properly as it only supports (as stated OP) 1903/1909/2004 (Officially)
     
  6. drew84

    drew84 MDL Expert

    Mar 13, 2014
    1,347
    2,302
    60
  7. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
  8. Zoiderof

    Zoiderof MDL Novice

    Apr 20, 2018
    15
    4
    0
    Why does LTSC not have a .cmd file and is not being mentioned in the title? I almost thought support was dropped while I was planning to move some of my dev/gaming stuff to LTSC from LTSB finally. I'm very critical of the GUI changes and behavior MS is going with it so I'm not interested in most of their updates, but I am forced to update due to advancements in DX12, WDDM, HDR and WCG and other infrastructural things I do not update at all, once I've installed LTSB I have updates completely disabled and will continue to do so with LTSC. Windows 10 has become a tweaking nightmare and I'm well experienced to not become a victim of redoing all of the carefully done settings and tweaks all over again each update, this is absolutely unacceptable, that's why we need to do a lot more what we had in Win7. This is where such tools come in and I appreciate this kind of project very very much, I may be contributing and reporting bugs as I go over my own LTSC installation as well as subsequent support. I do not know the full extent of this project jet, judging by it's name "setup script" it's quite a broad meaning, which means almost any kind of configuration automation is acceptable, correct? If this is the case I have many ideas for which we could improve this project even more, to create a great Win10 experience for powerusers and developers alike.

    I'm also in the process of first creating a NTLite custom ISO and hopefully this script will work somewhat okay, if not I'll be trying to figure out why and how to improve this project, support for such tweak combinations is important in order to better support those people who are really serious about getting their system tweaked to the max. It looks like it's meant to be used on a clean system, but I'll still go ahead because I have big plans I've been cooking up ever since I've installed my first Win10, but didn't had the time. I'm even open to contributing code and other help if I find the time and skills, or even donating, I would have already donated for supporting LTSC and my custom ISO and other custom settings ideas and keeping the support equal but I've yet to create a KoFi account, but I wished to donate a higher amount one-time in this case.
     
  9. abbath

    abbath MDL Novice

    Dec 18, 2009
    9
    1
    0
    I run the script on 2004,ita all ok but i have an yellow alert in Windows security center on a section app and function like browser and script disabled,its normal? Can i set ignore?
     
  10. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
    @Zoiderof, you do not need KoFi account to donate. it's just a PayPal system. I didn't mentioned LTSC script version due to I do not like LTSC (LOL). Users who use it is able to find it without releasing it via Releases page. That's my opinion. Now I'mthinking about how to rewrite the project into 5.0 version with presets.So far, there will be no LTSC releases with cmd (actually you can create it by youself).

    @abbath, what kind of browser and script functions disabled?
     
  11. drew84

    drew84 MDL Expert

    Mar 13, 2014
    1,347
    2,302
    60
    #32 drew84, Jul 20, 2020
    Last edited: Sep 18, 2020
    @farag, presenting this here for quick access/reference (for myself and other users at MDL) hope this is ok

    CHANGELOG: 4.5.0 to Present

    18.08.2020 (Version 4.60) <<< NEW
    Code:
        Updated
    
        * Fixed and improved translations and comments.
    
            * Closes Issue #58 First and second batch of translation updates + improvements
    
            * Closes Issue #59 fix inverted language in line 1290
    
          Thanks a lot to @skycommand for the help with translation;
    
        * Fixed wrong value in "Add the "Extract all" item to Windows Installer (.msi) context menu" section;
      
            To revert to the proper values run
            ----------------------------------------------------------------------------------------------------------------------------------------------------
            New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract -Name MUIVerb -PropertyType String -Value "@shell32.dll,-37514" -Force
            ----------------------------------------------------------------------------------------------------------------------------------------------------
          
    
        * Updated the "Turn off Delivery Optimization" section;
      
            To enable it run
            --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
            New-ItemProperty -Path Registry::HKEY_USERS\S-1-5-20\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Settings -Name DownloadMode -PropertyType DWord -Value 0 -Force
            New-ItemProperty -Path Registry::HKEY_USERS\S-1-5-20\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Settings -Name DownloadModeProvider -PropertyType DWord -Value 8 -Force
            --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
        * Updated the "Turn off Windows features" section;
      
            The "Microsoft Print to PDF" feature was excluded from disabling;
          
            To revert to the proper values run
            -----------------------------------------------------------------------------------------------------
            Enable-WindowsOptionalFeature -Online -FeatureName Printing-PrintToPDFServices-Features # -NoRestart
            -----------------------------------------------------------------------------------------------------
    
        * Updated the "Change the location of the user folders to %SystemDrive%" section;
      
            Added the RemoveDesktopINI argument to remove desktop.ini in the old user shell folder;
    
        * Updated the "Do not add the "- Shortcut" suffix to the file name of created shortcuts" section;
      
    
        * Removed the "Group svchost.exe processes" section;
      
            To revert to the default changes rub
            ----------------------------------------------------------------------------------------------------------------------------------------
            New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control -Name SvcHostSplitThresholdInKB -PropertyType DWord -Value 3670016 -Force
            ----------------------------------------------------------------------------------------------------------------------------------------
            # Restart required
    
        * Removed the "Show the "File Explorer" and "Settings" folders on Start" section;
      
    
        Minor changes.
    
        


    17.08.2020 (Version 4.5.7)

    Code:
        Updated
    
           * Removed "Turn off per-user services" section;
               Closes #50 Mail and Calendar app not working
                    & #52 Windows build 1909 Microsoft Mail doesn't login with my computer account
              
               To revert these services back run
                =====================================
               New-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\PimIndexMaintenanceSvc -Name Start -PropertyType DWord -Value 3 -Force
               Remove-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\PimIndexMaintenanceSvc -Name UserServiceFlags -Force
               New-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\UnistoreSvc -Name Start -PropertyType DWord -Value 3 -Force
               Remove-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\UnistoreSvc -Name UserServiceFlags -Force
               New-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\UserDataSvc -Name Start -PropertyType DWord -Value 3 -Force
               Remove-ItemProperty -Path HKLM:\System\CurrentControlSet\Services\UserDataSvc -Name UserServiceFlags -Force
                =====================================
               # Restart required
    
           * Updated "Turn on Windows 10 20H2 new Start style" section;
    
           * Updated "Change %TEMP% environment variable path to the %SystemDrive%\Temp" section;
    
               + Added prompt for choice;
          
                   Added symbolic link creation;
    
                 Closes #51 Ps4 remote play breaks even after restoring to a previous point
            
                   Create required folder
                   =====================================
                   New-Item -Path $env:LOCALAPPDATA\Temp -ItemType Directory -Force
                   =====================================
    
           * Minor changes.
    
    
        

    03.08.2020 (Version 4.5.6)
    Code:
     
        Updated
    
            * Added "Turn on Windows 10 20H2 new Start style" section. The new Start style described here;
    
            * Added "Install the Windows Subsystem for Linux (WSL)" section;
    
            * Added new package "Microsoft.Photos.MediaEngineDLC" to the $UncheckedAppxPackages variable in "Uninstall UWP apps" section;
    
            * region Edge removed (only for 1903/1909 Version);
     
       Comments
     
       Minor changes
    
        

    Code:
     
        Updated
    
            * Closed Issue #39 Can only add one App to High Graphics Performance
    
            * Closed Issue #40 Can only add one Controlled access folder (Similar to above)
     
       Comments
     
       Minor changes
    
        

    29.06.2020 (Version 4.5.4)
    Code:
     
       Updated
    
            * "Turn off Cortana autostarting" section
     
           * "Create "Process Creation" Event Viewer Custom View" section
     
              Closes Issue #37 Script Error while creating ProcessCreation.xml
     
       Removed
     
           * "Uninstall all Xbox related UWP apps from all accounts" section because it's unnecassary
    
     
           Additionally
     
            * Show accent color on Start, taskbar, and action center
     
            * Show accent color on the title bars and window borders
     
            * Increase taskbar transparency
     
             Closes Issue #36 Darkmode turns Taskbar Blue
     
     
       Comments
     
       Minor changes
    
        

    23.06.2020 (Version 4.5.3)
    Code:
     
       Updated
    
            * Help section
    
            * "Turn off Cortana autostarting" section
     
        Added
    
            * "Create "Process Creation" Event Viewer Custom View" section
     
              NOTE: For this custom view to function, it is necessary to enable the following sections
     
                      Turn on events auditing generated when a process is created or starts
                      Include command line in process creation events
            
                    This feature allows to conveniently track the creation of suspicious processes along with the process command line argument
                    Go to Event Viewer - Custom View - Process Creation
     
        Minor changes
    
        

    19.06.2020 (Version 4.5.2)
    Code:
     
        Updated
     
           * "Turn on logging for all Windows PowerShell modules" section
     
                Fixed typo in registry path key creation
     
                To restore execute in CMD
               CMD:-----------------------------------------------
    
                Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging\ModuleNames -Name EnableModuleLogging -Force
                New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ModuleLogging -Name EnableModuleLogging -PropertyType DWord -Value 1 -Force
     
               CMD:-----------------------------------------------
    
        Removed
     
           * Somesections due to Network troubleshooter is unable to start DPS service
     
               Stop event trace sessions
     
               Turn off the data collectors at the next computer restart
     
               To restore Network troubleshooter download attached DiagLog_EN.xml and execute in CMD
               CMD:-----------------------------------------------
    
                :: Restart needed
                logman import -name "DiagLog" -xml "PathTo\DiagLog_EN.xml"
                logman start "DiagLog"
     
               /CMD:-----------------------------------------------
    
        Minor changes
    
        

    17.06.2020 (Version 4.5.1)
    Code:
     
        Updated
     
           * "Unpin all the Start tiles" section
     
                Now using another method to unpin all Start tiles
     
           * "Pin the shortcuts to Start" section
     
           * Check for the internet connection
    
        

    11.06.2020 (Version 4.5.0.1)
    Code:
     
        Updated
     
           * "Remove Windows capabilities" section
    
                Moved Notepad from the $CheckedCapabilities variable to the $ExcludedCapabilities
    
                To restore previously uninstalled Notepad execute
               CMD:-----------------------------------------------
    
                Get-WindowsCapability -Online -Name Microsoft.Windows.Notepad* | Add-WindowsCapability -Online -Verbose
     
               /CMD:-----------------------------------------------
    
           * "Turn on hardware-accelerated GPU scheduling" section
     
                Added a section determining whether an OS is (or is not) installed on a virtual machine
    
        

    10.06.2020 (Version 4.5.0)
    Code:
     
        Updated
     
           * Stop event trace sessions
     
           * Turn off Windows features
     
           * Turn off background apps, except the followings...
     
           * Turn off and delete reserved storage after the next update installation
     
           * Hide the "Edit with Photos" item from the context menu
     
           * Hide the "Create a new video" item from the context menu
     
           * Hide the "Edit" item from the images context menu
     
           * Remove the "Bitmap image" item from the "New" context menu
     
           * Remove the "Rich Text Document" item from the "New" context menu.
    
        Added
     
           * Turn on automatically save my restartable apps when sign out and restart them after sign in
     
           * Turn off Cortana autostarting
     
           * Turn on hardware-accelerated GPU scheduling.
     
       Removed
     
           * Due to Microsoft Edge moved to Chromium rendering engine, the following sections was removed
    
               Remove Microsoft Edge shortcut from the Desktop;
    
               Do not allow Microsoft Edge to start and load the Start and New Tab page at Windows startup and each time Microsoft Edge is closed;
      
                   To remove unnecessary key execute
                   CMD:-----------------------------------------------
    
                   Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\TabPreloader -Name AllowTabPreloading -Force
      
                   /CMD:-----------------------------------------------
    
    
               Do not allow Microsoft Edge to pre-launch at Windows startup, when the system is idle, and each time Microsoft Edge is closed;
      
                   To remove unnecessary key execute
                   CMD:-----------------------------------------------
    
                    Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main -Name AllowPrelaunch -Force
          
                   /CMD:-----------------------------------------------
    
    
               Turn off Windows Defender SmartScreen for Microsoft Edge;
      
                   To remove unnecessary key execute
                   CMD:-----------------------------------------------
    
                   $edge = (Get-AppxPackage -Name Microsoft.MicrosoftEdge).PackageFamilyName
                   Remove-ItemProperty -Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\$edge\MicrosoftEdge\PhishingFilter" -Name EnabledV9 -Force
          
                   /CMD:-----------------------------------------------
    
    
               Turn off creation of an Edge shortcut on the desktop for each user profile;
      
                   To remove unnecessary key execute
                   CMD:-----------------------------------------------
    
                   Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name DisableEdgeDesktopShortcutCreation -Force
          
                   /CMD:-----------------------------------------------
     
       Renamed
     
           * In Windows 10
             the "Turn on automatic recommended troubleshooting and tell when problems get fixed" feature
             was renamed into "Run troubleshooters automatically, then notify"
    
        Comments
    
        Minor changes
    
        
     
  12. chinotto

    chinotto MDL Novice

    Aug 17, 2009
    20
    0
    0
    #33 chinotto, Jul 23, 2020
    Last edited: Jul 23, 2020
    hello is possible to convert powershell into cmd for unattended profile? I have 1809 pro, the script LTSC.ps1 is applicable or only Enterprise?
     
  13. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
    1809 and LTSC 1809 are the same, as I know.
     
  14. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
  15. drew84

    drew84 MDL Expert

    Mar 13, 2014
    1,347
    2,302
    60
    ... done
     
  16. jinbill

    jinbill MDL Novice

    Oct 21, 2018
    14
    4
    0
    is there a complete list of everything this script does?
    thanks!
     
  17. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
    Code:
    $file = Get-Content -Path "path to file"
    foreach ($line in $file)
    {
        if ($line.StartsWith("# "))
        {
            $line
        }
    }
    The code will show all strings that start with "#" (comments)
     
  18. jinbill

    jinbill MDL Novice

    Oct 21, 2018
    14
    4
    0
    Script instructions say:
    "Due to the fact that the script includes about 150 functions,
    you must read the entire script and comment out those sections that you do not want to be executed,
    otherwise likely you will enable features that you do not want to be enabled"

    what's the meaning of "comment out"? just delete the sections I don't want from the script or use a particular script symbol to "comment out"?
    thanks
     
  19. drew84

    drew84 MDL Expert

    Mar 13, 2014
    1,347
    2,302
    60
    #