Browse Source

19.09.2021 v6.0.4

pull/252/head
Dmitry Nefedov 3 years ago
committed by GitHub
parent
commit
17e64ee2a8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      Sophia/Windows 11/Functions.ps1
  2. 2
      Sophia/Windows 11/Localizations/de-DE/Sophia.psd1
  3. 2
      Sophia/Windows 11/Localizations/en-US/Sophia.psd1
  4. 2
      Sophia/Windows 11/Localizations/es-ES/Sophia.psd1
  5. 2
      Sophia/Windows 11/Localizations/fr-FR/Sophia.psd1
  6. 2
      Sophia/Windows 11/Localizations/hu-HU/Sophia.psd1
  7. 2
      Sophia/Windows 11/Localizations/it-IT/Sophia.psd1
  8. 2
      Sophia/Windows 11/Localizations/pt-BR/Sophia.psd1
  9. 2
      Sophia/Windows 11/Localizations/ru-RU/Sophia.psd1
  10. 2
      Sophia/Windows 11/Localizations/tr-TR/Sophia.psd1
  11. 2
      Sophia/Windows 11/Localizations/uk-UA/Sophia.psd1
  12. 2
      Sophia/Windows 11/Localizations/zh-CN/Sophia.psd1
  13. 2
      Sophia/Windows 11/Manifest/Sophia.psd1
  14. 191
      Sophia/Windows 11/Module/Sophia.psm1
  15. 49
      Sophia/Windows 11/Sophia.ps1

6
Sophia/Windows 11/Functions.ps1

@ -2,8 +2,8 @@
.SYNOPSIS .SYNOPSIS
The TAB completion for functions and their arguments The TAB completion for functions and their arguments
Version: v6.0.3 Version: v6.0.4
Date: 25.08.2021 Date: 19.09.2021
Copyright (c) 20142021 farag Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic Copyright (c) 20192021 farag & Inestic
@ -54,7 +54,7 @@ function Sophia
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.0.3 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014–2021" $Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.0.4 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014–2021"
Remove-Module -Name Sophia -Force -ErrorAction Ignore Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force

2
Sophia/Windows 11/Localizations/de-DE/Sophia.psd1

@ -1,6 +1,6 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = Das Skript unterstützt Windows 11 2004/20H2/21H1-Versionen und höher UnsupportedOSBuild = Das Skript unterstützt Windows 11 2004/20H2/21H1-Versionen und höher
UpdateWarning = Ihre Windows 11-Build: {0}.{1}. Unterstützter Build: 22000.160 und höher UpdateWarning = Ihr Windows 11-Build: {0}.{1}. Unterstützter Build: 22000.194 und höher
UnsupportedLanguageMode = Die PowerShell-Sitzung wird in einem eingeschränkten Sprachmodus ausgeführt UnsupportedLanguageMode = Die PowerShell-Sitzung wird in einem eingeschränkten Sprachmodus ausgeführt
LoggedInUserNotAdmin = Der angemeldete Benutzer hat keine Administratorrechte LoggedInUserNotAdmin = Der angemeldete Benutzer hat keine Administratorrechte
UnsupportedPowerShell = Sie versuchen, ein Skript über PowerShell {0}.{1} auszuführen. Führen Sie das Skript in der entsprechenden PowerShell-Version aus UnsupportedPowerShell = Sie versuchen, ein Skript über PowerShell {0}.{1} auszuführen. Führen Sie das Skript in der entsprechenden PowerShell-Version aus

2
Sophia/Windows 11/Localizations/en-US/Sophia.psd1

@ -1,6 +1,6 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = The script supports Windows 11 21H2 version and higher UnsupportedOSBuild = The script supports Windows 11 21H2 version and higher
UpdateWarning = Your Windows 11 build: {0}.{1}. Supported build: 22000.160 and higher UpdateWarning = Your Windows 11 build: {0}.{1}. Supported build: 22000.194 and higher
UnsupportedLanguageMode = The PowerShell session in running in a limited language mode UnsupportedLanguageMode = The PowerShell session in running in a limited language mode
LoggedInUserNotAdmin = The logged-on user doesn't have admin rights LoggedInUserNotAdmin = The logged-on user doesn't have admin rights
UnsupportedPowerShell = You're trying to run script via PowerShell {0}.{1}. Run the script in the appropriate PowerShell version UnsupportedPowerShell = You're trying to run script via PowerShell {0}.{1}. Run the script in the appropriate PowerShell version

2
Sophia/Windows 11/Localizations/es-ES/Sophia.psd1

@ -1,6 +1,6 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = El script es compatible con versión Windows 11 21H2 y superiores UnsupportedOSBuild = El script es compatible con versión Windows 11 21H2 y superiores
UpdateWarning = Su build de Windows 11: {0}.{1}. Compilación compatible: 22000.160 y superiores UpdateWarning = Su build de Windows 11: {0}.{1}. Compilación compatible: 22000.194 y superiores
UnsupportedLanguageMode = Sesión de PowerShell ejecutada en modo de lenguaje limitado UnsupportedLanguageMode = Sesión de PowerShell ejecutada en modo de lenguaje limitado
LoggedInUserNotAdmin = El usuario que inició sesión no tiene derechos de administrador LoggedInUserNotAdmin = El usuario que inició sesión no tiene derechos de administrador
UnsupportedPowerShell = Estás intentando ejecutar el script a través de PowerShell {0}.{1}. Ejecute el script en la versión apropiada de PowerShell UnsupportedPowerShell = Estás intentando ejecutar el script a través de PowerShell {0}.{1}. Ejecute el script en la versión apropiada de PowerShell

2
Sophia/Windows 11/Localizations/fr-FR/Sophia.psd1

@ -1,6 +1,6 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = Le script supporte les versions Windows 11 21H2 et ultérieures UnsupportedOSBuild = Le script supporte les versions Windows 11 21H2 et ultérieures
UpdateWarning = Votre version de Windows 11 : {0}.{1}. Version prise en charge : 22000.160 et ultérieures UpdateWarning = Votre version de Windows 11 : {0}.{1}. Version prise en charge : 22000.194 et ultérieures
UnsupportedLanguageMode = La session PowerShell s'exécute dans un mode de langue limité UnsupportedLanguageMode = La session PowerShell s'exécute dans un mode de langue limité
LoggedInUserNotAdmin = L'utilisateur connecté n'a pas de droits d'administrateur LoggedInUserNotAdmin = L'utilisateur connecté n'a pas de droits d'administrateur
UnsupportedPowerShell = Vous essayez d'exécuter le script via PowerShell {0}.{1}. Exécutez le script dans la version appropriée de PowerShell UnsupportedPowerShell = Vous essayez d'exécuter le script via PowerShell {0}.{1}. Exécutez le script dans la version appropriée de PowerShell

2
Sophia/Windows 11/Localizations/hu-HU/Sophia.psd1

@ -1,6 +1,6 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = A szkript a Windows 11 21H2 és újabb kiadásokat támogatja UnsupportedOSBuild = A szkript a Windows 11 21H2 és újabb kiadásokat támogatja
UpdateWarning = Az Ön Windows 11 építése: {0}.{1}. Támogatott build: 22000.160 és magasabb verziószámok UpdateWarning = Az Ön Windows 11 építése: {0}.{1}. Támogatott build: 22000.194 és magasabb verziószámok
UnsupportedLanguageMode = A PowerShell munkamenet korlátozott nyelvi üzemmódban fut UnsupportedLanguageMode = A PowerShell munkamenet korlátozott nyelvi üzemmódban fut
LoggedInUserNotAdmin = A bejelentkezett felhasználó nem rendelkezik admin jogokkal LoggedInUserNotAdmin = A bejelentkezett felhasználó nem rendelkezik admin jogokkal
UnsupportedPowerShell = A PowerShell {0}.{1} segítségével próbálja futtatni a szkriptet. Futtassa a szkriptet a megfelelő PowerShell-verzióban UnsupportedPowerShell = A PowerShell {0}.{1} segítségével próbálja futtatni a szkriptet. Futtassa a szkriptet a megfelelő PowerShell-verzióban

2
Sophia/Windows 11/Localizations/it-IT/Sophia.psd1

@ -1,6 +1,6 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = Lo script supporta Windows 11, 21H2 versioni e superiori UnsupportedOSBuild = Lo script supporta Windows 11, 21H2 versioni e superiori
UpdateWarning = La tua build di Windows 11: {0}.{1}. Build supportata: 22000.160 e successive UpdateWarning = La tua build di Windows 11: {0}.{1}. Build supportata: 22000.194 e successive
UnsupportedLanguageMode = La sessione PowerShell è in esecuzione in una modalità di lingua limitata UnsupportedLanguageMode = La sessione PowerShell è in esecuzione in una modalità di lingua limitata
LoggedInUserNotAdmin = L'utente connesso non ha i diritti di amministratore LoggedInUserNotAdmin = L'utente connesso non ha i diritti di amministratore
UnsupportedPowerShell = Stai cercando di eseguire lo script tramite PowerShell {0}.{1}. Esegui lo script nella versione di PowerShell appropriata UnsupportedPowerShell = Stai cercando di eseguire lo script tramite PowerShell {0}.{1}. Esegui lo script nella versione di PowerShell appropriata

2
Sophia/Windows 11/Localizations/pt-BR/Sophia.psd1

@ -1,6 +1,6 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = O script suporta versões Windows 11 21H2 e superior UnsupportedOSBuild = O script suporta versões Windows 11 21H2 e superior
UpdateWarning = La tua build di Windows 11: {0}.{1}. Build supportata: 22000.160 e successive UpdateWarning = La tua build di Windows 11: {0}.{1}. Build supportata: 22000.194 e successive
UnsupportedLanguageMode = A sessão PowerShell em funcionamento em um modo de linguagem limitada UnsupportedLanguageMode = A sessão PowerShell em funcionamento em um modo de linguagem limitada
LoggedInUserNotAdmin = O usuário logado não tem direitos de administrador LoggedInUserNotAdmin = O usuário logado não tem direitos de administrador
UnsupportedPowerShell = Você está tentando executar o script via PowerShell {0}.{1}. Execute o script na versão apropriada do PowerShell UnsupportedPowerShell = Você está tentando executar o script via PowerShell {0}.{1}. Execute o script na versão apropriada do PowerShell

2
Sophia/Windows 11/Localizations/ru-RU/Sophia.psd1

@ -1,6 +1,6 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = Скрипт поддерживает только Windows 11 21H2 и выше UnsupportedOSBuild = Скрипт поддерживает только Windows 11 21H2 и выше
UpdateWarning = Ваш билд Windows 11: {0}.{1}. Поддерживаемый билд: 22000.160 и выше UpdateWarning = Ваш билд Windows 11: {0}.{1}. Поддерживаемый билд: 22000.194 и выше
UnsupportedLanguageMode = Сессия PowerShell работает в ограниченном режиме UnsupportedLanguageMode = Сессия PowerShell работает в ограниченном режиме
LoggedInUserNotAdmin = Текущий вошедший пользователь не обладает правами администратора LoggedInUserNotAdmin = Текущий вошедший пользователь не обладает правами администратора
UnsupportedPowerShell = Вы пытаетесь запустить скрипт в PowerShell {0}.{1}. Запустите скрипт в соответствующей версии PowerShell UnsupportedPowerShell = Вы пытаетесь запустить скрипт в PowerShell {0}.{1}. Запустите скрипт в соответствующей версии PowerShell

2
Sophia/Windows 11/Localizations/tr-TR/Sophia.psd1

@ -1,6 +1,6 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = Bu betik sadece Windows 11 21H2 sürüm ve üstünü destekliyor UnsupportedOSBuild = Bu betik sadece Windows 11 21H2 sürüm ve üstünü destekliyor
UpdateWarning = Windows 11 yapınız: {0}.{1}. Desteklenen yapı: 22000.160 ve üstünü destekliyor UpdateWarning = Windows 11 yapınız: {0}.{1}. Desteklenen yapı: 22000.194 ve üstünü destekliyor
UnsupportedLanguageMode = Sınırlı bir dil modunda çalışan PowerShell oturumu UnsupportedLanguageMode = Sınırlı bir dil modunda çalışan PowerShell oturumu
LoggedInUserNotAdmin = Oturum açan kullanıcının yönetici hakları yok LoggedInUserNotAdmin = Oturum açan kullanıcının yönetici hakları yok
UnsupportedPowerShell = Komut dosyasını PowerShell {0}.{1} aracılığıyla çalıştırmaya çalışıyorsunuz. Komut dosyasını uygun PowerShell sürümünde çalıştırın UnsupportedPowerShell = Komut dosyasını PowerShell {0}.{1} aracılığıyla çalıştırmaya çalışıyorsunuz. Komut dosyasını uygun PowerShell sürümünde çalıştırın

2
Sophia/Windows 11/Localizations/uk-UA/Sophia.psd1

@ -1,6 +1,6 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = Скрипт підтримує тільки Windows 11 версії 21H2 та вище UnsupportedOSBuild = Скрипт підтримує тільки Windows 11 версії 21H2 та вище
UpdateWarning = Ваш білд Windows 11: {0}.{1}. Підтримуваний білд: 22000.160 та вище UpdateWarning = Ваш білд Windows 11: {0}.{1}. Підтримуваний білд: 22000.194 та вище
UnsupportedLanguageMode = Сесія PowerShell працює в обмеженому режимі UnsupportedLanguageMode = Сесія PowerShell працює в обмеженому режимі
LoggedInUserNotAdmin = Поточний увійшов користувач не володіє правами адміністратора LoggedInUserNotAdmin = Поточний увійшов користувач не володіє правами адміністратора
UnsupportedPowerShell = Ви намагаєтеся запустити скрипт в PowerShell {0}.{1}. Запустіть скрипт у відповідній версії PowerShell UnsupportedPowerShell = Ви намагаєтеся запустити скрипт в PowerShell {0}.{1}. Запустіть скрипт у відповідній версії PowerShell

2
Sophia/Windows 11/Localizations/zh-CN/Sophia.psd1

@ -1,6 +1,6 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = 该脚本支持Windows 11版本21H2和更高版本 UnsupportedOSBuild = 该脚本支持Windows 11版本21H2和更高版本
UpdateWarning = 您的Windows 11构建{0}.{1}支持的构建22000.160和更高版本 UpdateWarning = 您的Windows 11构建{0}.{1}支持的构建22000.194和更高版本
UnsupportedLanguageMode = PowerShell会话在有限的语言模式下运行 UnsupportedLanguageMode = PowerShell会话在有限的语言模式下运行
LoggedInUserNotAdmin = 登录的用户没有管理员的权利 LoggedInUserNotAdmin = 登录的用户没有管理员的权利
UnsupportedPowerShell = 你想通过PowerShell {0}.{1}运行脚本在适当的PowerShell版本中运行该脚本 UnsupportedPowerShell = 你想通过PowerShell {0}.{1}运行脚本在适当的PowerShell版本中运行该脚本

2
Sophia/Windows 11/Manifest/Sophia.psd1

@ -1,6 +1,6 @@
@{ @{
RootModule = '..\Module\Sophia.psm1' RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '6.0.3' ModuleVersion = '6.0.4'
GUID = '109cc881-c42b-45af-a74a-550781989d6a' GUID = '109cc881-c42b-45af-a74a-550781989d6a'
Author = 'Dmitry "farag" Nefedov' Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014–2021 farag & Inestic. All rights reserved' Copyright = '(c) 2014–2021 farag & Inestic. All rights reserved'

191
Sophia/Windows 11/Module/Sophia.psm1

@ -2,8 +2,8 @@
.SYNOPSIS .SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v6.0.3 Version: v6.0.4
Date: 25.08.2021 Date: 19.09.2021
Copyright (c) 20142021 farag Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic Copyright (c) 20192021 farag & Inestic
@ -16,7 +16,7 @@
.NOTES .NOTES
Supported Windows 11 version Supported Windows 11 version
Version: 21H2 Version: 21H2
Build: 22000.160 Build: 22000.194
Editions: Home/Pro/Enterprise Editions: Home/Pro/Enterprise
.NOTES .NOTES
@ -30,15 +30,15 @@
https://t.me/sophianews https://t.me/sophianews
https://t.me/sophia_chat https://t.me/sophia_chat
.LINK Authors .NOTES
https://github.com/farag2
https://github.com/Inestic
.LINK
https://forum.ru-board.com/topic.cgi?forum=62&topic=30617#15 https://forum.ru-board.com/topic.cgi?forum=62&topic=30617#15
https://habr.com/company/skillfactory/blog/553800/ https://habr.com/company/skillfactory/blog/553800/
https://forums.mydigitallife.net/threads/powershell-windows-10-sophia-script.81675/ https://forums.mydigitallife.net/threads/powershell-windows-10-sophia-script.81675/
https://www.reddit.com/r/PowerShell/comments/go2n5v/powershell_script_setup_windows_10/ https://www.reddit.com/r/PowerShell/comments/go2n5v/powershell_script_setup_windows_10/
.LINK Authors
https://github.com/farag2
https://github.com/Inestic
#> #>
#region Checkings #region Checkings
@ -66,18 +66,26 @@ function Checkings
} }
} }
# Check whether the OS minor build version is 160 minimum # Check whether the OS minor build version is 194 minimum
switch ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -ge 160) switch ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -ge 194)
{ {
$false $false
{ {
$Version = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" $Version = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion"
Write-Warning -Message ($Localization.UpdateWarning -f $Version.CurrentBuild, $Version.UBR) Write-Warning -Message ($Localization.UpdateWarning -f $Version.CurrentBuild, $Version.UBR)
# Check for updates # Receive updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
Start-Sleep -Seconds 1
# Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate-action" Start-Process -FilePath "ms-settings:windowsupdate-action"
Start-Sleep -Seconds 3
Start-Process -FilePath "ms-settings:windowsupdate-optionalupdates" Start-Sleep -Seconds 1
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
exit exit
} }
@ -93,7 +101,7 @@ function Checkings
Start-Sleep -Seconds 5 Start-Sleep -Seconds 5
Start-Process -FilePath "https://docs.microsoft.com/en-us/windows/whats-new/windows-11-requirements" Start-Process -FilePath "https://docs.microsoft.com/windows/whats-new/windows-11-requirements"
exit exit
} }
} }
@ -179,7 +187,7 @@ function Checkings
} }
# Unblock all files in the script folder by removing the Zone.Identifier alternate data stream with a value of "3" # Unblock all files in the script folder by removing the Zone.Identifier alternate data stream with a value of "3"
Get-ChildItem -Path $PSScriptRoot -Recurse -Force | Unblock-File Get-ChildItem -Path $PSScriptRoot\..\ -File -Recurse -Force | Unblock-File
# Display a warning message about whether a user has customized the preset file # Display a warning message about whether a user has customized the preset file
if ($Warning) if ($Warning)
@ -232,12 +240,12 @@ function Checkings
#endregion Checkings #endregion Checkings
#region Protection #region Protection
# Enable script logging. The log will be being recorded into the script folder # Enable script logging. The log will be being recorded into the script root folder
# To stop logging just close the console or type "Stop-Transcript" # To stop logging just close the console or type "Stop-Transcript"
function Logging function Logging
{ {
$TrascriptFilename = "Log-$((Get-Date).ToString("dd.MM.yyyy-HH-mm"))" $TrascriptFilename = "Log-$((Get-Date).ToString("dd.MM.yyyy-HH-mm"))"
Start-Transcript -Path $PSScriptRoot\$TrascriptFilename.txt -Force Start-Transcript -Path $PSScriptRoot\..\$TrascriptFilename.txt -Force
} }
# Create a restore point for the system drive # Create a restore point for the system drive
@ -514,7 +522,7 @@ function FeedbackFrequency
} }
"Automatically" "Automatically"
{ {
Remove-Item -Path HKCU:\SOFTWARE\Microsoft\Siuf\Rules -Force -ErrorAction SilentlyContinue Remove-Item -Path HKCU:\SOFTWARE\Microsoft\Siuf\Rules -Force -ErrorAction Ignore
} }
} }
} }
@ -801,10 +809,13 @@ function ScheduledTasks
if (-not ($Tasks)) if (-not ($Tasks))
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.NoData -Verbose Write-Verbose -Message $Localization.NoData -Verbose
return return
} }
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.DialogBoxOpening -Verbose Write-Verbose -Message $Localization.DialogBoxOpening -Verbose
#region Sendkey function #region Sendkey function
@ -1509,7 +1520,7 @@ function Windows10FileExplorer
} }
"Disable" "Disable"
{ {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -Force Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -Force -ErrorAction Ignore
} }
} }
@ -2053,24 +2064,27 @@ function FileTransferDialog
<# <#
.SYNOPSIS .SYNOPSIS
The File Explorer ribbon The Windows 10 File Explorer ribbon
.PARAMETER Expanded .PARAMETER Expanded
Expand the File Explorer ribbon Expand the Windows 10 File Explorer ribbon
.PARAMETER Minimized .PARAMETER Minimized
Minimize the File Explorer ribbon Minimize the Windows 10 File Explorer ribbon
.EXAMPLE .EXAMPLE
FileExplorerRibbon -Expanded Windows10FileExplorerRibbon -Expanded
.EXAMPLE .EXAMPLE
FileExplorerRibbon -Minimized Windows10FileExplorerRibbon -Minimized
.NOTES
In order this feature to work you need to enable the Windows 10 File Explorer (Windows10FileExplorer -Enable)
.NOTES .NOTES
Current user Current user
#> #>
function FileExplorerRibbon function Windows10FileExplorerRibbon
{ {
param param
( (
@ -2617,9 +2631,8 @@ public static string GetString(uint strId)
if (Test-Path -Path "$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Edge.lnk") if (Test-Path -Path "$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Edge.lnk")
{ {
# Call the shortcut context menu item # Call the shortcut context menu item
$Shell = New-Object -ComObject Shell.Application $Shell = (New-Object -ComObject Shell.Application).NameSpace("$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar")
$Folder = $Shell.NameSpace("$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar") $Shortcut = $Shell.ParseName("Microsoft Edge.lnk")
$Shortcut = $Folder.ParseName("Microsoft Edge.lnk")
$Shortcut.Verbs() | Where-Object -FilterScript {$_.Name -eq $LocalizedString} | ForEach-Object -Process {$_.DoIt()} $Shortcut.Verbs() | Where-Object -FilterScript {$_.Name -eq $LocalizedString} | ForEach-Object -Process {$_.DoIt()}
} }
} }
@ -2930,11 +2943,11 @@ function FirstLogonAnimation
{ {
"Disable" "Disable"
{ {
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableFirstLogonAnimation -PropertyType DWord -Value 0 -Force New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name EnableFirstLogonAnimation -PropertyType DWord -Value 0 -Force
} }
"Enable" "Enable"
{ {
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableFirstLogonAnimation -PropertyType DWord -Value 1 -Force New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name EnableFirstLogonAnimation -PropertyType DWord -Value 1 -Force
} }
} }
} }
@ -3373,6 +3386,7 @@ function OneDrive
[string]$UninstallString = Get-Package -Name "Microsoft OneDrive" -ProviderName Programs -ErrorAction Ignore | ForEach-Object -Process {$_.Meta.Attributes["UninstallString"]} [string]$UninstallString = Get-Package -Name "Microsoft OneDrive" -ProviderName Programs -ErrorAction Ignore | ForEach-Object -Process {$_.Meta.Attributes["UninstallString"]}
if ($UninstallString) if ($UninstallString)
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.OneDriveUninstalling -Verbose Write-Verbose -Message $Localization.OneDriveUninstalling -Verbose
Stop-Process -Name OneDrive -Force -ErrorAction Ignore Stop-Process -Name OneDrive -Force -ErrorAction Ignore
@ -3512,25 +3526,40 @@ public static bool MarkFileDelete (string sourcefile)
{ {
if (Test-Path -Path $env:SystemRoot\SysWOW64\OneDriveSetup.exe) if (Test-Path -Path $env:SystemRoot\SysWOW64\OneDriveSetup.exe)
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.OneDriveInstalling -Verbose Write-Verbose -Message $Localization.OneDriveInstalling -Verbose
Start-Process -FilePath $env:SystemRoot\SysWOW64\OneDriveSetup.exe Start-Process -FilePath $env:SystemRoot\SysWOW64\OneDriveSetup.exe
} }
else else
{ {
# Downloading the latest OneDrive
try try
{ {
# Downloading the latest OneDrive installer x64
if ((Invoke-WebRequest -Uri https://www.google.com -UseBasicParsing -DisableKeepAlive -Method Head).StatusDescription) if ((Invoke-WebRequest -Uri https://www.google.com -UseBasicParsing -DisableKeepAlive -Method Head).StatusDescription)
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.OneDriveDownloading -Verbose Write-Verbose -Message $Localization.OneDriveDownloading -Verbose
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Parse XML to get the URL
# https://go.microsoft.com/fwlink/p/?LinkID=844652
$Parameters = @{
Uri = "https://g.live.com/1rewlive5skydrive/OneDriveProduction"
UseBasicParsing = $true
Verbose = $true
}
$Content = Invoke-RestMethod @Parameters
# Remove invalid chars
[xml]$OneDriveXML = $Content -replace "", ""
$OneDriveURL = ($OneDriveXML).root.update.amd64binary.url[-1]
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}" $DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}"
$Parameters = @{ $Parameters = @{
Uri = "https://go.microsoft.com/fwlink/p/?LinkID=2121808" Uri = $OneDriveURL
OutFile = "$DownloadsFolder\OneDriveSetup.exe" OutFile = "$DownloadsFolder\OneDriveSetup.exe"
Verbose = [switch]::Present Verbose = $true
} }
Invoke-WebRequest @Parameters Invoke-WebRequest @Parameters
@ -3549,6 +3578,7 @@ public static bool MarkFileDelete (string sourcefile)
} }
Get-ScheduledTask -TaskName "Onedrive* Update*" | Enable-ScheduledTask Get-ScheduledTask -TaskName "Onedrive* Update*" | Enable-ScheduledTask
Get-ScheduledTask -TaskName "Onedrive* Update*" | Start-ScheduledTask
} }
} }
} }
@ -3790,10 +3820,10 @@ function Hibernation
The %TEMP% environment variable path The %TEMP% environment variable path
.PARAMETER SystemDrive .PARAMETER SystemDrive
Change the %TEMP% environment variable path to "%SystemDrive%\Temp" Change the %TEMP% environment variable path to %SystemDrive%\Temp
.PARAMETER Default .PARAMETER Default
Change the %TEMP% environment variable path to "%LOCALAPPDATA%\Temp" Change the %TEMP% environment variable path to %LOCALAPPDATA%\Temp
.EXAMPLE .EXAMPLE
TempFolder -SystemDrive TempFolder -SystemDrive
@ -3921,7 +3951,7 @@ Unregister-ScheduledTask -TaskName SymbolicLink -Confirm:`$false
} }
#region main #region main
# Change the %TEMP% environment variable path to "%LOCALAPPDATA%\Temp" # Change the %TEMP% environment variable path to %LOCALAPPDATA%\Temp
[Environment]::SetEnvironmentVariable("TMP", "$env:SystemDrive\Temp", "User") [Environment]::SetEnvironmentVariable("TMP", "$env:SystemDrive\Temp", "User")
[Environment]::SetEnvironmentVariable("TMP", "$env:SystemDrive\Temp", "Machine") [Environment]::SetEnvironmentVariable("TMP", "$env:SystemDrive\Temp", "Machine")
[Environment]::SetEnvironmentVariable("TMP", "$env:SystemDrive\Temp", "Process") [Environment]::SetEnvironmentVariable("TMP", "$env:SystemDrive\Temp", "Process")
@ -4029,7 +4059,7 @@ Unregister-ScheduledTask -TaskName TemporaryTask -Confirm:`$false
} }
#region main #region main
# Change the %TEMP% environment variable path to "%LOCALAPPDATA%\Temp" # Change the %TEMP% environment variable path to %LOCALAPPDATA%\Temp
[Environment]::SetEnvironmentVariable("TMP", "$env:LOCALAPPDATA\Temp", "User") [Environment]::SetEnvironmentVariable("TMP", "$env:LOCALAPPDATA\Temp", "User")
[Environment]::SetEnvironmentVariable("TMP", "$env:SystemRoot\TEMP", "Machine") [Environment]::SetEnvironmentVariable("TMP", "$env:SystemRoot\TEMP", "Machine")
[Environment]::SetEnvironmentVariable("TMP", "$env:LOCALAPPDATA\Temp", "Process") [Environment]::SetEnvironmentVariable("TMP", "$env:LOCALAPPDATA\Temp", "Process")
@ -4247,7 +4277,7 @@ function MappedDrivesAppElevatedAccess
} }
"Disable" "Disable"
{ {
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLinkedConnections -PropertyType DWord -Value 0 -Force Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLinkedConnections -Force -ErrorAction Ignore
} }
} }
} }
@ -4670,6 +4700,7 @@ function WindowsFeatures
} }
} }
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose Write-Verbose -Message $Localization.Patient -Verbose
# Getting list of all optional features according to the conditions # Getting list of all optional features according to the conditions
@ -4681,10 +4712,13 @@ function WindowsFeatures
if (-not ($Features)) if (-not ($Features))
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.NoData -Verbose Write-Verbose -Message $Localization.NoData -Verbose
return return
} }
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.DialogBoxOpening -Verbose Write-Verbose -Message $Localization.DialogBoxOpening -Verbose
#region Sendkey function #region Sendkey function
@ -4950,6 +4984,7 @@ function WindowsCapabilities
function UninstallButton function UninstallButton
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose Write-Verbose -Message $Localization.Patient -Verbose
[void]$Window.Close() [void]$Window.Close()
@ -4959,12 +4994,14 @@ function WindowsCapabilities
if ([string]$SelectedCapabilities.Name -match "Browser.InternetExplorer") if ([string]$SelectedCapabilities.Name -match "Browser.InternetExplorer")
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.RestartWarning Write-Warning -Message $Localization.RestartWarning
} }
} }
function InstallButton function InstallButton
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose Write-Verbose -Message $Localization.Patient -Verbose
[void]$Window.Close() [void]$Window.Close()
@ -4974,6 +5011,7 @@ function WindowsCapabilities
if ([string]$SelectedCapabilities.Name -match "Browser.InternetExplorer") if ([string]$SelectedCapabilities.Name -match "Browser.InternetExplorer")
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.RestartWarning Write-Warning -Message $Localization.RestartWarning
} }
} }
@ -5051,6 +5089,7 @@ function WindowsCapabilities
} }
} }
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose Write-Verbose -Message $Localization.Patient -Verbose
# Getting list of all capabilities according to the conditions # Getting list of all capabilities according to the conditions
@ -5062,10 +5101,13 @@ function WindowsCapabilities
if (-not ($Capabilities)) if (-not ($Capabilities))
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.NoData -Verbose Write-Verbose -Message $Localization.NoData -Verbose
return return
} }
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.DialogBoxOpening -Verbose Write-Verbose -Message $Localization.DialogBoxOpening -Verbose
#region Sendkey function #region Sendkey function
@ -5815,6 +5857,7 @@ public static string GetString(uint strId)
{ {
"Root" "Root"
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.RetrievingDrivesList -Verbose Write-Verbose -Message $Localization.RetrievingDrivesList -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -5838,7 +5881,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DesktopLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DesktopLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -5872,7 +5914,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DocumentsLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DocumentsLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -5906,7 +5947,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DownloadsLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DownloadsLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -5940,7 +5980,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $MusicLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $MusicLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -5972,8 +6011,8 @@ public static string GetString(uint strId)
$CurrentUserFolderLocation = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "My Pictures" $CurrentUserFolderLocation = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "My Pictures"
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $PicturesLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $PicturesLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue
Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -6007,7 +6046,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $VideosLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $VideosLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -6041,7 +6079,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DesktopLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DesktopLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -6085,7 +6122,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DocumentsLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DocumentsLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -6129,7 +6165,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DownloadsLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DownloadsLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -6173,7 +6208,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $MusicLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $MusicLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -6217,7 +6251,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $PicturesLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $PicturesLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -6261,7 +6294,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $VideosLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $VideosLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -6307,7 +6339,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DesktopLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DesktopLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -6338,7 +6369,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DocumentsLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DocumentsLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -6369,7 +6399,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DownloadsLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $DownloadsLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -6400,7 +6429,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $MusicLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $MusicLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -6431,7 +6459,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $PicturesLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $PicturesLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -6462,7 +6489,6 @@ public static string GetString(uint strId)
Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $VideosLocalizedString, $CurrentUserFolderLocation) -Verbose Write-Verbose -Message ($Localization.CurrentUserFolderLocation -f $VideosLocalizedString, $CurrentUserFolderLocation) -Verbose
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.FilesWontBeMoved Write-Warning -Message $Localization.FilesWontBeMoved
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -6556,7 +6582,7 @@ function WinPrtScrFolder
{ {
if (Test-Path -Path $OpenedFolder) if (Test-Path -Path $OpenedFolder)
{ {
Invoke-Item -Path $OpenedFolder Start-Process -FilePath explorer -ArgumentList $OpenedFolder
} }
} }
} }
@ -6572,7 +6598,7 @@ function WinPrtScrFolder
Ask me before running troubleshooter Ask me before running troubleshooter
.EXAMPLE .EXAMPLE
RecommendedTroubleshooting -Automatic RecommendedTroubleshooting -Automatically
.EXAMPLE .EXAMPLE
RecommendedTroubleshooting -Default RecommendedTroubleshooting -Default
@ -6589,10 +6615,10 @@ function RecommendedTroubleshooting
( (
[Parameter( [Parameter(
Mandatory = $true, Mandatory = $true,
ParameterSetName = "Automatic" ParameterSetName = "Automatically"
)] )]
[switch] [switch]
$Automatic, $Automatically,
[Parameter( [Parameter(
Mandatory = $true, Mandatory = $true,
@ -6604,7 +6630,7 @@ function RecommendedTroubleshooting
switch ($PSCmdlet.ParameterSetName) switch ($PSCmdlet.ParameterSetName)
{ {
"Automatic" "Automatically"
{ {
if (-not (Test-Path -Path HKLM:\SOFTWARE\Microsoft\WindowsMitigation)) if (-not (Test-Path -Path HKLM:\SOFTWARE\Microsoft\WindowsMitigation))
{ {
@ -6795,7 +6821,7 @@ function F1HelpPage
} }
"Enable" "Enable"
{ {
Remove-Item -Path "HKCU:\SOFTWARE\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee}" -Recurse -Force -ErrorAction SilentlyContinue Remove-Item -Path "HKCU:\SOFTWARE\Classes\Typelib\{8cec5860-07a1-11d9-b15e-000d56bfe6ee}" -Recurse -Force -ErrorAction Ignore
} }
} }
} }
@ -6897,7 +6923,7 @@ function CapsLock
} }
"Enable" "Enable"
{ {
Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout" -Name "Scancode Map" -Force Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout" -Name "Scancode Map" -Force -ErrorAction Ignore
} }
} }
} }
@ -7895,6 +7921,7 @@ namespace FileAssoc
Set-Icon -ProgId $ProgId -Icon $Icon Set-Icon -ProgId $ProgId -Icon $Icon
} }
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose Write-Verbose -Message $Localization.Patient -Verbose
# Setting additional parameters to comply with the requirements before configuring the extension # Setting additional parameters to comply with the requirements before configuring the extension
@ -8499,6 +8526,7 @@ function UninstallUWPApps
$AllUsers $AllUsers
) )
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose Write-Verbose -Message $Localization.Patient -Verbose
$AppxPackages = @(Get-AppxPackage -PackageTypeFilter Bundle -AllUsers:$AllUsers | Where-Object -FilterScript {$_.Name -notin $ExcludedAppxPackages}) $AppxPackages = @(Get-AppxPackage -PackageTypeFilter Bundle -AllUsers:$AllUsers | Where-Object -FilterScript {$_.Name -notin $ExcludedAppxPackages})
@ -8591,6 +8619,7 @@ function UninstallUWPApps
function ButtonUninstallClick function ButtonUninstallClick
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose Write-Verbose -Message $Localization.Patient -Verbose
$Window.Close() | Out-Null $Window.Close() | Out-Null
@ -8678,10 +8707,12 @@ function UninstallUWPApps
if ($AppxPackages.Count -eq 0) if ($AppxPackages.Count -eq 0)
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.NoData -Verbose Write-Verbose -Message $Localization.NoData -Verbose
} }
else else
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.DialogBoxOpening -Verbose Write-Verbose -Message $Localization.DialogBoxOpening -Verbose
#region Sendkey function #region Sendkey function
@ -8762,7 +8793,7 @@ function RestoreUWPApps
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Name="Window" Name="Window"
MinHeight="400" MinWidth="410" MinHeight="400" MinWidth="410"
SizeToContent="WidthAndHeight" WindowStartupLocation="CenterScreen" SizeToContent="Width" WindowStartupLocation="CenterScreen"
TextOptions.TextFormattingMode="Display" SnapsToDevicePixels="True" TextOptions.TextFormattingMode="Display" SnapsToDevicePixels="True"
FontFamily="Candara" FontSize="16" ShowInTaskbar="True" FontFamily="Candara" FontSize="16" ShowInTaskbar="True"
Background="#F1F1F1" Foreground="#262626"> Background="#F1F1F1" Foreground="#262626">
@ -8839,11 +8870,17 @@ function RestoreUWPApps
#region Functions #region Functions
function Get-AppxManifest function Get-AppxManifest
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose Write-Verbose -Message $Localization.Patient -Verbose
# You cannot retrieve packages using -PackageTypeFilter Bundle, otherwise you won't get the InstallLocation attribute. It can be retrieved only by comparing with $Bundles # You cannot retrieve packages using -PackageTypeFilter Bundle, otherwise you won't get the InstallLocation attribute. It can be retrieved only by comparing with $Bundles
$Bundles = (Get-AppXPackage -PackageTypeFilter Bundle -AllUsers).Name $Bundles = (Get-AppXPackage -PackageTypeFilter Bundle -AllUsers).Name
$AppxPackages = Get-AppxPackage -AllUsers | Where-Object -FilterScript {$_.PackageUserInformation -match "Staged"} | Where-Object -FilterScript {$_.Name -in $Bundles} $AppxPackages = @(Get-AppxPackage -AllUsers | Where-Object -FilterScript {$_.PackageUserInformation -match "Staged"} | Where-Object -FilterScript {$_.Name -in $Bundles})
# The Bundle packages contains no Microsoft Teams
if (Get-AppxPackage -Name MicrosoftTeams -AllUsers)
{
$AppxPackages += Get-AppxPackage -Name MicrosoftTeams -AllUsers | Where-Object -FilterScript {$_.PackageUserInformation -match "Staged"}
}
$PackagesIds = [Windows.Management.Deployment.PackageManager, Windows.Web, ContentType = WindowsRuntime]::new().FindPackages() | Select-Object -Property DisplayName -ExpandProperty Id | Select-Object -Property Name, DisplayName $PackagesIds = [Windows.Management.Deployment.PackageManager, Windows.Web, ContentType = WindowsRuntime]::new().FindPackages() | Select-Object -Property DisplayName -ExpandProperty Id | Select-Object -Property Name, DisplayName
foreach ($AppxPackage in $AppxPackages) foreach ($AppxPackage in $AppxPackages)
@ -8912,6 +8949,7 @@ function RestoreUWPApps
function ButtonRestoreClick function ButtonRestoreClick
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose Write-Verbose -Message $Localization.Patient -Verbose
$Window.Close() | Out-Null $Window.Close() | Out-Null
@ -8920,8 +8958,8 @@ function RestoreUWPApps
Register = $true Register = $true
ForceApplicationShutdown = $true ForceApplicationShutdown = $true
ForceUpdateFromAnyVersion = $true ForceUpdateFromAnyVersion = $true
DisableDevelopmentMod = $true DisableDevelopmentMode = $true
Verbose = [switch]::Present Verbose = $true
} }
$PackagesToRestore | Add-AppxPackage @Parameters $PackagesToRestore | Add-AppxPackage @Parameters
} }
@ -8994,10 +9032,12 @@ function RestoreUWPApps
if ($AppxPackages.Count -eq 0) if ($AppxPackages.Count -eq 0)
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.NoData -Verbose Write-Verbose -Message $Localization.NoData -Verbose
} }
else else
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.DialogBoxOpening -Verbose Write-Verbose -Message $Localization.DialogBoxOpening -Verbose
#region Sendkey function #region Sendkey function
@ -9104,7 +9144,7 @@ function HEIF
"Install" "Install"
{ {
# Check whether the extension is already installed # Check whether the extension is already installed
if (-not (Get-AppxPackage -Name Microsoft.HEVCVideoExtension) -and (Get-AppxPackage -Name Microsoft.Windows.Photos)) if ((-not (Get-AppxPackage -Name Microsoft.HEVCVideoExtension)) -and (Get-AppxPackage -Name Microsoft.Windows.Photos))
{ {
try try
{ {
@ -9144,7 +9184,7 @@ function HEIF
$Parameters = @{ $Parameters = @{
Uri = $TempURL Uri = $TempURL
OutFile = "$DownloadsFolder\$Package" OutFile = "$DownloadsFolder\$Package"
Verbose = [switch]::Present Verbose = $true
} }
Invoke-WebRequest @Parameters Invoke-WebRequest @Parameters
@ -9450,6 +9490,7 @@ function SetAppGraphicsPerformance
} }
"1" "1"
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Skipped -Verbose Write-Verbose -Message $Localization.Skipped -Verbose
} }
} }
@ -10365,7 +10406,7 @@ function EventViewerCustomView
} }
"Disable" "Disable"
{ {
Remove-Item -Path "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" -Force -ErrorAction SilentlyContinue Remove-Item -Path "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" -Force -ErrorAction Ignore
} }
} }
} }
@ -10884,16 +10925,15 @@ function MSIExtractContext
{ {
New-Item -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract\Command -Force New-Item -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract\Command -Force
} }
$Value = "{0}" -f 'msiexec.exe /a "%1" /qb TARGETDIR="%1 extracted"' $Value = "{0}" -f "msiexec.exe /a `"%1`" /qb TARGETDIR=`"%1 extracted`""
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract\Command -Name "(default)" -PropertyType String -Value $Value -Force New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract\Command -Name "(default)" -PropertyType String -Value $Value -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract -Name MUIVerb -PropertyType String -Value "@shell32.dll,-37514" -Force New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract -Name MUIVerb -PropertyType String -Value "@shell32.dll,-37514" -Force
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract -Name Icon -PropertyType String -Value "shell32.dll,-16817" -Force New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract -Name Icon -PropertyType String -Value "shell32.dll,-16817" -Force
} }
"Hide" "Hide"
{ {
Remove-Item -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract -Recurse -Force -ErrorAction SilentlyContinue Remove-Item -Path Registry::HKEY_CLASSES_ROOT\Msi.Package\shell\Extract -Recurse -Force -ErrorAction Ignore
} }
} }
} }
@ -10950,9 +10990,8 @@ function CABInstallContext
} }
"Hide" "Hide"
{ {
Remove-Item -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs -Recurse -Force -ErrorAction SilentlyContinue Remove-Item -Path Registry::HKEY_CLASSES_ROOT\CABFolder\Shell\RunAs -Recurse -Force -ErrorAction Ignore
} }
} }
} }
@ -11809,13 +11848,13 @@ function Errors
{ {
if ($Global:Error) if ($Global:Error)
{ {
($Global:Error | ForEach-Object -Process {
# Some errors may have the Windows nature and don't have a path to any of the module's files # Some errors may have the Windows nature and don't have a path to any of the module's files
$ErrorInFile = if ($_.InvocationInfo.PSCommandPath) $ErrorInFile = if ($_.InvocationInfo.PSCommandPath)
{ {
Split-Path -Path $_.InvocationInfo.PSCommandPath -Leaf Split-Path -Path $_.InvocationInfo.PSCommandPath -Leaf
} }
($Global:Error | ForEach-Object -Process {
[PSCustomObject]@{ [PSCustomObject]@{
$Localization.ErrorsLine = $_.InvocationInfo.ScriptLineNumber $Localization.ErrorsLine = $_.InvocationInfo.ScriptLineNumber
$Localization.ErrorsFile = $ErrorInFile $Localization.ErrorsFile = $ErrorInFile

49
Sophia/Windows 11/Sophia.ps1

@ -2,8 +2,8 @@
.SYNOPSIS .SYNOPSIS
Default preset file for "Sophia Script for Windows 11" Default preset file for "Sophia Script for Windows 11"
Version: v6.0.3 Version: v6.0.4
Date: 25.08.2021 Date: 19.09.2021
Copyright (c) 20142021 farag Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic Copyright (c) 20192021 farag & Inestic
@ -21,19 +21,20 @@
.EXAMPLE Run the script by specifying the module functions as an argument .EXAMPLE Run the script by specifying the module functions as an argument
.\Sophia.ps1 -Functions "DiagTrackService -Disable", "DiagnosticDataLevel -Minimal", UninstallUWPApps .\Sophia.ps1 -Functions "DiagTrackService -Disable", "DiagnosticDataLevel -Minimal", UninstallUWPApps
.EXAMPLE Download and expand the archive (without running) the latest Sophia Script according which Windows and PowerShell versions it is run on
irm script.sophi.app | iex
Invoke-RestMethod -Uri script.sophi.app | Invoke-Expression
.NOTES .NOTES
Supported Windows 11 version Supported Windows 11 version
Version: 21H2 Version: 21H2
Build: 22000 Build: 22000.194
Editions: Home/Pro/Enterprise Editions: Home/Pro/Enterprise
.NOTES .NOTES
Set execution policy to be able to run scripts only in the current PowerShell session: Set execution policy to be able to run scripts only in the current PowerShell session:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force
.NOTES
Running the script is best done on a fresh install because running it on wrong tweaked system may result in errors occurring
.NOTES .NOTES
To use the TAB completion for functions and their arguments dot source the Function.ps1 script first: To use the TAB completion for functions and their arguments dot source the Function.ps1 script first:
. .\Function.ps1 (with a dot at the beginning) . .\Function.ps1 (with a dot at the beginning)
@ -70,7 +71,7 @@ param
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.0.3 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014–2021" $Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.0.4 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014–2021"
Remove-Module -Name Sophia -Force -ErrorAction Ignore Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force
@ -352,13 +353,23 @@ FileTransferDialog -Detailed
# Отображать диалоговое окно передачи файлов в свернутом виде (значение по умолчанию) # Отображать диалоговое окно передачи файлов в свернутом виде (значение по умолчанию)
# FileTransferDialog -Compact # FileTransferDialog -Compact
# Expand the File Explorer ribbon <#
# Развернуть ленту проводника Expand the Windows 10 File Explorer ribbon
FileExplorerRibbon -Expanded In order this feature to work you need to enable the Windows 10 File Explorer (Windows10FileExplorer -Enable)
# Minimize the File Explorer ribbon (default value) Развернуть ленту проводника как в Windows 10
# Свернуть ленту проводника (значение по умолчанию) Для того, чтобы работал данный функционал, вам необходимо включить проводник из Windows 10 (Windows10FileExplorer -Enable)
# FileExplorerRibbon -Minimized #>
Windows10FileExplorerRibbon -Expanded
<#
Minimize the Windows 10 File Explorer ribbon
In order this feature to work you need to enable the Windows 10 File Explorer (Windows10FileExplorer -Enable)
Свернуть ленту проводника как в Windows 10
Для того, чтобы работал данный функционал, вам необходимо включить проводник из Windows 10 (Windows10FileExplorer -Enable)
#>
# Windows10FileExplorerRibbon -Minimized
# Display the recycle bin files delete confirmation dialog # Display the recycle bin files delete confirmation dialog
# Запрашивать подтверждение на удаление файлов в корзину # Запрашивать подтверждение на удаление файлов в корзину
@ -529,11 +540,11 @@ AppsLanguageSwitch -Enable
# AppsLanguageSwitch -Disable # AppsLanguageSwitch -Disable
# When I grab a windows's title bar and shake it, minimize all other windows # When I grab a windows's title bar and shake it, minimize all other windows
# При захвате заголовка окна и встряхивании сворачивать все остальные окна # При захвате заголовка окна и встряхивании сворачиваются все остальные окна
AeroShaking -Enable AeroShaking -Enable
# When I grab a windows's title bar and shake it, don't minimize all other windows (default value) # When I grab a windows's title bar and shake it, don't minimize all other windows (default value)
# При захвате заголовка окна и встряхивании не сворачивать все остальные окна (значение по умолчанию) # При захвате заголовка окна и встряхивании не сворачиваются все остальные окна (значение по умолчанию)
# AeroShaking -Disable # AeroShaking -Disable
#endregion UI & Personalization #endregion UI & Personalization
@ -783,7 +794,7 @@ WinPrtScrFolder -Desktop
Автоматически запускать средства устранения неполадок, а затем уведомлять Автоматически запускать средства устранения неполадок, а затем уведомлять
Чтобы заработала данная функция, уровень сбора диагностических данных ОС будет установлен на "Необязательные диагностические данные" и включится создание отчетов об ошибках Windows Чтобы заработала данная функция, уровень сбора диагностических данных ОС будет установлен на "Необязательные диагностические данные" и включится создание отчетов об ошибках Windows
#> #>
RecommendedTroubleshooting -Automatic RecommendedTroubleshooting -Automatically
<# <#
Ask me before running troubleshooter (default value) Ask me before running troubleshooter (default value)
@ -969,7 +980,7 @@ HEIF -Install
Открыть страницу "Расширения для видео HEVC от производителя устройства" в Microsoft Store, чтобы вручную установить расширение для открытия форматов .heic и .heif Открыть страницу "Расширения для видео HEVC от производителя устройства" в Microsoft Store, чтобы вручную установить расширение для открытия форматов .heic и .heif
Расширение может быть установлено бесплатно без учетной записи Microsoft Расширение может быть установлено бесплатно без учетной записи Microsoft
#> #>
# HEIF -Manual # HEIF -Manually
# Disable Cortana autostarting # Disable Cortana autostarting
# Выключить автозагрузку Кортана # Выключить автозагрузку Кортана
@ -981,11 +992,11 @@ CortanaAutostart -Disable
# Disable Microsoft Teams autostarting # Disable Microsoft Teams autostarting
# Выключить автозагрузку Microsoft Teams # Выключить автозагрузку Microsoft Teams
CortanaAutostart -Disable TeamsAutostart -Disable
# Enable Microsoft Teams autostarting (default value) # Enable Microsoft Teams autostarting (default value)
# Включить автозагрузкуMicrosoft Teams (значение по умолчанию) # Включить автозагрузкуMicrosoft Teams (значение по умолчанию)
# CortanaAutostart -Enable # TeamsAutostart -Enable
# Check for UWP apps updates # Check for UWP apps updates
# Проверить обновления UWP-приложений # Проверить обновления UWP-приложений

Loading…
Cancel
Save