diff --git a/src/Sophia_Script_for_Windows_10/Localizations/en-US/Sophia.psd1 b/src/Sophia_Script_for_Windows_10/Localizations/en-US/Sophia.psd1 index 5c5b1477..8370bb4c 100644 --- a/src/Sophia_Script_for_Windows_10/Localizations/en-US/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_10/Localizations/en-US/Sophia.psd1 @@ -65,6 +65,6 @@ Restore = Restore Run = Run Skipped = Function "{0}" skipped. GPOUpdate = Updating GPO... -ThankfulToastTitle = Thank you for using of Sophia Script +ThankfulToastTitle = Thank you for using Sophia Script DonateToastButton = Donate '@ diff --git a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 index 0f0e686a..36da7fbc 100644 --- a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 @@ -15212,21 +15212,6 @@ public static void PostMessage() } } - # Apply policies found in registry to re-build database database because gpedit.msc relies in its own database - if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt")) - { - if (Test-Path -Path "$env:TEMP\Computer.txt") - { - & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" - } - if (Test-Path -Path "$env:TEMP\User.txt") - { - & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" - } - - gpupdate /force - } - # Call MeetNow unless binary value is reverted if (-not $Script:MeetNow) { @@ -15237,10 +15222,6 @@ public static void PostMessage() MeetNow -Show } - # PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word - # https://github.com/PowerShell/PowerShell/issues/21070 - Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore - # Kill all explorer instances in case "launch folder windows in a separate process" enabled Get-Process -Name explorer | Stop-Process -Force Start-Sleep -Seconds 3 @@ -15331,11 +15312,29 @@ public static void PostMessage() [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Sophia").Show($ToastMessage) #endregion Toast notifications + # Apply policies found in registry to re-build database database because gpedit.msc relies in its own database + if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt")) + { + if (Test-Path -Path "$env:TEMP\Computer.txt") + { + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" + } + if (Test-Path -Path "$env:TEMP\User.txt") + { + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" + } + + gpupdate /force + } + + # PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word + # https://github.com/PowerShell/PowerShell/issues/21070 + Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore + Write-Verbose -Message "https://t.me/sophia_chat" -Verbose Write-Verbose -Message "https://t.me/sophianews" -Verbose Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose Write-Verbose -Message "https://ko-fi.com/Q5Q51QUJC" -Verbose - } #endregion Post Actions diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2019/Localizations/en-US/Sophia.psd1 b/src/Sophia_Script_for_Windows_10_LTSC_2019/Localizations/en-US/Sophia.psd1 index 767918e4..b3dbe26f 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2019/Localizations/en-US/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2019/Localizations/en-US/Sophia.psd1 @@ -56,6 +56,6 @@ Restore = Restore Run = Run Skipped = Function "{0}" skipped. GPOUpdate = Updating GPO... -ThankfulToastTitle = Thank you for using of Sophia Script +ThankfulToastTitle = Thank you for using Sophia Script DonateToastButton = Donate '@ diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 index d9735127..ba31dcda 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 @@ -11678,25 +11678,6 @@ public static void PostMessage() } } - # Apply policies found in registry to re-build database database because gpedit.msc relies in its own database - if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt")) - { - if (Test-Path -Path "$env:TEMP\Computer.txt") - { - & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" - } - if (Test-Path -Path "$env:TEMP\User.txt") - { - & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" - } - - gpupdate /force - } - - # PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word - # https://github.com/PowerShell/PowerShell/issues/21070 - Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore - # Kill all explorer instances in case "launch folder windows in a separate process" enabled Get-Process -Name explorer | Stop-Process -Force Start-Sleep -Seconds 3 @@ -11792,6 +11773,24 @@ public static void PostMessage() Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose Write-Verbose -Message "https://ko-fi.com/Q5Q51QUJC" -Verbose + # Apply policies found in registry to re-build database database because gpedit.msc relies in its own database + if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt")) + { + if (Test-Path -Path "$env:TEMP\Computer.txt") + { + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" + } + if (Test-Path -Path "$env:TEMP\User.txt") + { + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" + } + + gpupdate /force + } + + # PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word + # https://github.com/PowerShell/PowerShell/issues/21070 + Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore } #endregion Post Actions diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2021/Localizations/en-US/Sophia.psd1 b/src/Sophia_Script_for_Windows_10_LTSC_2021/Localizations/en-US/Sophia.psd1 index a0ac6007..b72c9cfc 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2021/Localizations/en-US/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2021/Localizations/en-US/Sophia.psd1 @@ -58,6 +58,6 @@ Restore = Restore Run = Run Skipped = Function "{0}" skipped. GPOUpdate = Updating GPO... -ThankfulToastTitle = Thank you for using of Sophia Script +ThankfulToastTitle = Thank you for using Sophia Script DonateToastButton = Donate '@ diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 index f8466cf9..e4e70c7e 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 @@ -13043,25 +13043,6 @@ public static void PostMessage() } } - # Apply policies found in registry to re-build database database because gpedit.msc relies in its own database - if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt")) - { - if (Test-Path -Path "$env:TEMP\Computer.txt") - { - & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" - } - if (Test-Path -Path "$env:TEMP\User.txt") - { - & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" - } - - gpupdate /force - } - - # PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word - # https://github.com/PowerShell/PowerShell/issues/21070 - Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore - # Kill all explorer instances in case "launch folder windows in a separate process" enabled Get-Process -Name explorer | Stop-Process -Force Start-Sleep -Seconds 3 @@ -13157,6 +13138,24 @@ public static void PostMessage() Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose Write-Verbose -Message "https://ko-fi.com/Q5Q51QUJC" -Verbose + # Apply policies found in registry to re-build database database because gpedit.msc relies in its own database + if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt")) + { + if (Test-Path -Path "$env:TEMP\Computer.txt") + { + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" + } + if (Test-Path -Path "$env:TEMP\User.txt") + { + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" + } + + gpupdate /force + } + + # PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word + # https://github.com/PowerShell/PowerShell/issues/21070 + Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore } #endregion Post Actions diff --git a/src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/en-US/Sophia.psd1 b/src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/en-US/Sophia.psd1 index 62125c07..8c34397d 100644 --- a/src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/en-US/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/en-US/Sophia.psd1 @@ -66,6 +66,6 @@ Restore = Restore Run = Run Skipped = Function "{0}" skipped. GPOUpdate = Updating GPO... -ThankfulToastTitle = Thank you for using of Sophia Script +ThankfulToastTitle = Thank you for using Sophia Script DonateToastButton = Donate '@ diff --git a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 index c1d47db7..a5f98678 100644 --- a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 @@ -15242,21 +15242,6 @@ public static void PostMessage() } } - # Apply policies found in registry to re-build database database because gpedit.msc relies in its own database - if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt")) - { - if (Test-Path -Path "$env:TEMP\Computer.txt") - { - & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" - } - if (Test-Path -Path "$env:TEMP\User.txt") - { - & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" - } - - gpupdate /force - } - # Call MeetNow unless binary value is reverted if (-not $Script:MeetNow) { @@ -15267,10 +15252,6 @@ public static void PostMessage() MeetNow -Show } - # PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word - # https://github.com/PowerShell/PowerShell/issues/21070 - Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore - # Kill all explorer instances in case "launch folder windows in a separate process" enabled Get-Process -Name explorer | Stop-Process -Force Start-Sleep -Seconds 3 @@ -15366,6 +15347,24 @@ public static void PostMessage() Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose Write-Verbose -Message "https://ko-fi.com/Q5Q51QUJC" -Verbose + # Apply policies found in registry to re-build database database because gpedit.msc relies in its own database + if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt")) + { + if (Test-Path -Path "$env:TEMP\Computer.txt") + { + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" + } + if (Test-Path -Path "$env:TEMP\User.txt") + { + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" + } + + gpupdate /force + } + + # PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word + # https://github.com/PowerShell/PowerShell/issues/21070 + Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore } #endregion Post Actions diff --git a/src/Sophia_Script_for_Windows_11/Localizations/en-US/Sophia.psd1 b/src/Sophia_Script_for_Windows_11/Localizations/en-US/Sophia.psd1 index 0a155b8f..b78fd5b2 100644 --- a/src/Sophia_Script_for_Windows_11/Localizations/en-US/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11/Localizations/en-US/Sophia.psd1 @@ -62,6 +62,6 @@ Restore = Restore Run = Run Skipped = Function "{0}" skipped. GPOUpdate = Updating GPO... -ThankfulToastTitle = Thank you for using of Sophia Script +ThankfulToastTitle = Thank you for using Sophia Script DonateToastButton = Donate '@ diff --git a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 index 5f0bf172..43dc2a3b 100644 --- a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 @@ -14206,25 +14206,6 @@ public static void PostMessage() } } - # Apply policies found in registry to re-build database database because gpedit.msc relies in its own database - if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt")) - { - if (Test-Path -Path "$env:TEMP\Computer.txt") - { - & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" - } - if (Test-Path -Path "$env:TEMP\User.txt") - { - & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" - } - - gpupdate /force - } - - # PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word - # https://github.com/PowerShell/PowerShell/issues/21070 - Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore - # Kill all explorer instances in case "launch folder windows in a separate process" enabled Get-Process -Name explorer | Stop-Process -Force Start-Sleep -Seconds 3 @@ -14315,11 +14296,29 @@ public static void PostMessage() [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Sophia").Show($ToastMessage) #endregion Toast notifications + # Apply policies found in registry to re-build database database because gpedit.msc relies in its own database + if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt")) + { + if (Test-Path -Path "$env:TEMP\Computer.txt") + { + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" + } + if (Test-Path -Path "$env:TEMP\User.txt") + { + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" + } + + gpupdate /force + } + + # PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word + # https://github.com/PowerShell/PowerShell/issues/21070 + Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore + Write-Verbose -Message "https://t.me/sophia_chat" -Verbose Write-Verbose -Message "https://t.me/sophianews" -Verbose Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose Write-Verbose -Message "https://ko-fi.com/Q5Q51QUJC" -Verbose - } #endregion Post Actions diff --git a/src/Sophia_Script_for_Windows_11_LTSC_2024/Localizations/en-US/Sophia.psd1 b/src/Sophia_Script_for_Windows_11_LTSC_2024/Localizations/en-US/Sophia.psd1 index c8fe23af..07aaa213 100644 --- a/src/Sophia_Script_for_Windows_11_LTSC_2024/Localizations/en-US/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11_LTSC_2024/Localizations/en-US/Sophia.psd1 @@ -59,6 +59,6 @@ Restore = Restore Run = Run Skipped = Function "{0}" skipped. GPOUpdate = Updating GPO... -ThankfulToastTitle = Thank you for using of Sophia Script +ThankfulToastTitle = Thank you for using Sophia Script DonateToastButton = Donate '@ diff --git a/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 index f6494edb..9a85eb12 100644 --- a/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 @@ -13035,25 +13035,6 @@ public static void PostMessage() } } - # Apply policies found in registry to re-build database database because gpedit.msc relies in its own database - if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt")) - { - if (Test-Path -Path "$env:TEMP\Computer.txt") - { - & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" - } - if (Test-Path -Path "$env:TEMP\User.txt") - { - & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" - } - - gpupdate /force - } - - # PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word - # https://github.com/PowerShell/PowerShell/issues/21070 - Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore - # Kill all explorer instances in case "launch folder windows in a separate process" enabled Get-Process -Name explorer | Stop-Process -Force Start-Sleep -Seconds 3 @@ -13144,11 +13125,29 @@ public static void PostMessage() [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Sophia").Show($ToastMessage) #endregion Toast notifications + # Apply policies found in registry to re-build database database because gpedit.msc relies in its own database + if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt")) + { + if (Test-Path -Path "$env:TEMP\Computer.txt") + { + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" + } + if (Test-Path -Path "$env:TEMP\User.txt") + { + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" + } + + gpupdate /force + } + + # PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word + # https://github.com/PowerShell/PowerShell/issues/21070 + Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore + Write-Verbose -Message "https://t.me/sophia_chat" -Verbose Write-Verbose -Message "https://t.me/sophianews" -Verbose Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose Write-Verbose -Message "https://ko-fi.com/Q5Q51QUJC" -Verbose - } #endregion Post Actions diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/en-US/Sophia.psd1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/en-US/Sophia.psd1 index cafaf941..26a4a73f 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/en-US/Sophia.psd1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/en-US/Sophia.psd1 @@ -63,6 +63,6 @@ Restore = Restore Run = Run Skipped = Function "{0}" skipped. GPOUpdate = Updating GPO... -ThankfulToastTitle = Thank you for using of Sophia Script +ThankfulToastTitle = Thank you for using Sophia Script DonateToastButton = Donate '@ diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 index 14921022..1adfb9e9 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 @@ -14236,25 +14236,6 @@ public static void PostMessage() } } - # Apply policies found in registry to re-build database database because gpedit.msc relies in its own database - if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt")) - { - if (Test-Path -Path "$env:TEMP\Computer.txt") - { - & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" - } - if (Test-Path -Path "$env:TEMP\User.txt") - { - & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" - } - - gpupdate /force - } - - # PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word - # https://github.com/PowerShell/PowerShell/issues/21070 - Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore - # Kill all explorer instances in case "launch folder windows in a separate process" enabled Get-Process -Name explorer | Stop-Process -Force Start-Sleep -Seconds 3 @@ -14345,11 +14326,29 @@ public static void PostMessage() [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Sophia").Show($ToastMessage) #endregion Toast notifications + # Apply policies found in registry to re-build database database because gpedit.msc relies in its own database + if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt")) + { + if (Test-Path -Path "$env:TEMP\Computer.txt") + { + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" + } + if (Test-Path -Path "$env:TEMP\User.txt") + { + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" + } + + gpupdate /force + } + + # PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word + # https://github.com/PowerShell/PowerShell/issues/21070 + Get-ChildItem -Path "$env:TEMP\Computer.txt", "$env:TEMP\User.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore + Write-Verbose -Message "https://t.me/sophia_chat" -Verbose Write-Verbose -Message "https://t.me/sophianews" -Verbose Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose Write-Verbose -Message "https://ko-fi.com/Q5Q51QUJC" -Verbose - } #endregion Post Actions