Browse Source

05.10.2021 v6.0.5

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

6
Sophia Script/Sophia Script for Windows 11/Functions.ps1

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

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

@ -16,6 +16,7 @@ OneDriveDownloading = OneDrive herunterladen... ~33 MB
WindowsFeaturesTitle = Windows-Features
OptionalFeaturesTitle = Optionale Features
EnableHardwareVT = Virtualisierung in UEFI aktivieren
OpenInWindowsTerminalAdmin = Open in Windows Terminal (Admin)
UserShellFolderNotEmpty = Im Ordner "{0}" befinden sich noch Dateien \nVerschieben Sie sie manuell an einen neuen Ort
RetrievingDrivesList = Abrufen der Laufwerksliste...
DriveSelect = Wählen Sie das Laufwerk aus, in dessen Stammverzeichnis der Ordner "{0}" erstellt werden soll
@ -73,6 +74,7 @@ Run = Starten
SelectAll = Wählen Sie Alle
Skip = Überspringen
Skipped = Übersprungen
FileExplorerRestartPrompt = Manchmal muss der Datei-Explorer neu gestartet werden, damit die Änderungen wirksam werden
TelegramGroupTitle = Treten Sie unserer offiziellen Telegram-Gruppe bei
TelegramChannelTitle = Treten Sie unserem offiziellen Telegram-Kanal bei
Uninstall = Deinstallieren

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

@ -16,6 +16,7 @@ OneDriveDownloading = Downloading OneDrive... ~33 MB
WindowsFeaturesTitle = Windows features
OptionalFeaturesTitle = Optional features
EnableHardwareVT = Enable Virtualization in UEFI
OpenInWindowsTerminalAdmin = Open in Windows Terminal (Admin)
UserShellFolderNotEmpty = Some files left in the "{0}" folder. Move them manually to a new location
RetrievingDrivesList = Retrieving drives list...
DriveSelect = Select the drive within the root of which the "{0}" folder will be created
@ -73,6 +74,7 @@ Run = Run
SelectAll = Select all
Skip = Skip
Skipped = Skipped
FileExplorerRestartPrompt = Sometimes in order for the changes to take effect the File Explorer process has to be restarted
TelegramGroupTitle = Join our official Telegram group
TelegramChannelTitle = Join our official Telegram channel
Uninstall = Uninstall

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

@ -15,6 +15,7 @@ OneDriveInstalling = Instalación de OneDrive...
OneDriveDownloading = Descargando OneDrive... ~33 MB
WindowsFeaturesTitle = Características de Windows
OptionalFeaturesTitle = Características opcionales
OpenInWindowsTerminalAdmin = Abrir en el terminal de Windows (administrador)
EnableHardwareVT = Habilitar la virtualización en UEFI
UserShellFolderNotEmpty = Algunos archivos quedan en la carpeta "{0}". Moverlos manualmente a una nueva ubicación
RetrievingDrivesList = Recuperando lista de unidades...
@ -73,6 +74,7 @@ Run = Iniciar
SelectAll = Seleccionar todo
Skip = Omitir
Skipped = Omitido
FileExplorerRestartPrompt = A veces, para que los cambios surtan efecto, hay que reiniciar el proceso del Explorador de archivos
TelegramGroupTitle = Únete a nuestro grupo oficial de Telegram
TelegramChannelTitle = Únete a nuestro canal oficial de Telegram
Uninstall = Desinstalar

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

@ -15,6 +15,7 @@ OneDriveInstalling = Installation de OneDrive...
OneDriveDownloading = Téléchargement de OneDrive... ~33 Mo
WindowsFeaturesTitle = Fonctionnalités
OptionalFeaturesTitle = Fonctionnalités optionnelles
OpenInWindowsTerminalAdmin = Ouvrir dans le Windows Terminal (Admin)
EnableHardwareVT = Activer la virtualisation dans UEFI
UserShellFolderNotEmpty = Certains fichiers laissés dans le dossier "{0}". Déplacer les manuellement vers un nouvel emplacement
RetrievingDrivesList = Récupération de la liste des lecteurs...
@ -73,6 +74,7 @@ Run = Démarrer
SelectAll = Tout sélectionner
Skip = Passer
Skipped = Passé
FileExplorerRestartPrompt = Parfois, pour que les modifications soient prises en compte, il faut redémarrer l'Explorateur de fichiers
TelegramGroupTitle = Rejoignez notre groupe Telegram officiel
TelegramChannelTitle = Rejoignez notre canal Telegram officiel
Uninstall = Désinstaller

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

@ -16,6 +16,7 @@ OneDriveDownloading = OneDrive letöltése... ~33 MB
WindowsFeaturesTitle = Windows szolgáltatások
OptionalFeaturesTitle = Opcionális szolgáltatások
EnableHardwareVT = Virtualizáció engedélyezése UEFI-ben
OpenInWindowsTerminalAdmin = Megnyitás a Windows terminálon (admin)
UserShellFolderNotEmpty = Néhány fájl maradt a "{0}" könyvtárban. Kérem helyezze át ezeket egy új helyre
RetrievingDrivesList = A meghajtók listájának lekérése...
DriveSelect = Válassza ki a meghajtó jelét a gyökérkönyvtárban ahol a "{0}" könyvtár létre lesz hozva
@ -73,6 +74,7 @@ Run = Futtatás
SelectAll = Összes kijelölése
Skip = Átugrás
Skipped = Átugorva
FileExplorerRestartPrompt = Néha ahhoz, hogy a módosítások hatályba lépjenek, a File Explorer folyamatot újra kell indítani
TelegramGroupTitle = Pridružite se našoj službenoj grupi Telegram
TelegramChannelTitle = Pridružite se našem službenom kanalu Telegram
Uninstall = Eltávolít

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

@ -16,6 +16,7 @@ OneDriveDownloading = Download di OneDrive... ~33 MB
WindowsFeaturesTitle = Funzionalità di Windows
OptionalFeaturesTitle = Caratteristiche opzionali
EnableHardwareVT = Abilita virtualizzazione in UEFI
OpenInWindowsTerminalAdmin = Aprire in Windows Terminal (Admin)
UserShellFolderNotEmpty = Alcuni file lasciati nella cartella "{0}". li spostare manualmente in una nuova posizione
RetrievingDrivesList = Recupero lista unità...
DriveSelect = Selezionare l'unità all'interno della radice del quale verrà creato il "{0}" cartella
@ -73,6 +74,7 @@ Run = Eseguire
SelectAll = Seleziona tutto
Skip = Salta
Skipped = Saltato
FileExplorerRestartPrompt = A volte, affinché le modifiche abbiano effetto, il processo di File Explorer deve essere riavviato
TelegramGroupTitle = Unisciti al nostro gruppo ufficiale Telegram
TelegramChannelTitle = Unisciti al nostro canale ufficiale di Telegram
Uninstall = Disinstallare

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

@ -16,6 +16,7 @@ OneDriveDownloading = Baixando OneDrive... ~33 MB
WindowsFeaturesTitle = Recursos do Windows
OptionalFeaturesTitle = Recursos opcionais
EnableHardwareVT = Habilitar virtualização em UEFI
OpenInWindowsTerminalAdmin = Abrir no Windows Terminal (Admin)
UserShellFolderNotEmpty = Alguns arquivos deixados na pasta "{0}". Movê-los manualmente para um novo local
RetrievingDrivesList = Recuperando lista de unidades...
DriveSelect = Selecione a unidade dentro da raiz da qual a pasta "{0}" será criada
@ -73,6 +74,7 @@ Run = Executar
SelectAll = Selecionar tudo
Skip = Pular
Skipped = Ignorados
FileExplorerRestartPrompt = Por vezes, para que as alterações tenham efeito, o processo File Explorer tem de ser reiniciado
TelegramGroupTitle = Entre no grupo oficial do Telegram
TelegramChannelTitle = Entre no canal oficial do Telegram
Uninstall = Desinstalar

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

@ -16,6 +16,7 @@ OneDriveDownloading = Скачивается OneDrive... ~
WindowsFeaturesTitle = Компоненты Windows
OptionalFeaturesTitle = Дополнительные компоненты
EnableHardwareVT = Включите виртуализацию в UEFI
OpenInWindowsTerminalAdmin = Открыть в Windows Terminal (администратор)
UserShellFolderNotEmpty = В папке "{0}" остались файлы. Переместите их вручную в новое расположение
RetrievingDrivesList = Получение списка дисков...
DriveSelect = Выберите диск, в корне которого будет создана папка "{0}"
@ -73,6 +74,7 @@ Run = Запустить
SelectAll = Выбрать всё
Skip = Пропустить
Skipped = Пропущено
FileExplorerRestartPrompt = Иногда для того, чтобы изменения вступили в силу, процесс проводника необходимо перезапустить
TelegramGroupTitle = Присоединяйтесь к нашей официальной группе в Telegram
TelegramChannelTitle = Присоединяйтесь к нашему официальному каналу в Telegram
Uninstall = Удалить

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

@ -16,6 +16,7 @@ OneDriveDownloading = OneDrive indiriliyor... ~33 MB
WindowsFeaturesTitle = Windows özellikleri
OptionalFeaturesTitle = İsteğe bağlı özellikler
EnableHardwareVT = UEFI'dan sanallaştırmayı aktifleştirin
OpenInWindowsTerminalAdmin = Windows Terminalinde (Yönetici)
UserShellFolderNotEmpty = "{0}" klasöründe bazı dosyalar kaldı. \nKendiniz yeni konuma taşıyın
RetrievingDrivesList = Sürücü listesi alınıyor...
DriveSelect = "{0}" klasörünün oluşturulacağı kök içindeki sürücüyü seçin
@ -73,6 +74,7 @@ Run = Başlat
SelectAll = Hepsini seç
Skip = Atla
Skipped = Atlandı
FileExplorerRestartPrompt = Bazen değişikliklerin geçerli olması için Dosya Gezgini işleminin yeniden başlatılması gerekir
TelegramGroupTitle = Resmi Telegram grubumuza katılın
TelegramChannelTitle = Resmi Telegram kanalımıza katılın
Uninstall = Kaldır

4
Sophia Script/Sophia Script for Windows 11/Localizations/uk-UA/Sophia.psd1

@ -16,6 +16,7 @@ OneDriveDownloading = Завантажується OneDriv
WindowsFeaturesTitle = Компоненти Windows
OptionalFeaturesTitle = Додаткові компоненти
EnableHardwareVT = Увімкніть віртуалізацію в UEFI
OpenInWindowsTerminalAdmin = Відкрити в Windows Terminal (адміністратор)
UserShellFolderNotEmpty = У папці "{0}" залишились файли. Перемістіть їх вручну у нове розташування
RetrievingDrivesList = Отримання списку дисків...
DriveSelect = Виберіть диск, в корні якого буде створена папка для "{0}"
@ -73,7 +74,8 @@ Run = Запустити
SelectAll = Вибрати все
Skip = Пропустити
Skipped = Пропущено
TelegramGroupTitle = Приєднуйтесь до нашої офіційної групи Telegram
FileExplorerRestartPrompt = Іноді для того, щоб зміни вступили в силу, процес провідника необхідно перезапустити
TelegramGroupTitle = Приєднуйтесь до нашої офіційної групи в Telegram
TelegramChannelTitle = Приєднуйтесь до нашого офіційного каналу в Telegram
Uninstall = Видалити
'@

1
Sophia Script/Sophia Script for Windows 11/Localizations/zh-CN/Sophia.psd1

@ -73,6 +73,7 @@ Run = 运行
SelectAll = 全选
Skip = 跳过
Skipped = 已跳过
FileExplorerRestartPrompt = 有时为了使更改生效必须重新启动文件管理器进程
TelegramGroupTitle = 加入我们的官方Telegram
TelegramChannelTitle = 加入我们的官方Telegram 频道
Uninstall = 卸载

2
Sophia Script/Sophia Script for Windows 11/Manifest/Sophia.psd1

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

476
Sophia Script/Sophia Script for Windows 11/Module/Sophia.psm1

@ -2,8 +2,8 @@
.SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v6.0.4
Date: 19.09.2021
Version: v6.0.5
Date: 05.10.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
@ -91,7 +91,7 @@ function Checkings
}
}
<# Check the TPM supported version ###
<# Check whether fTPM 2.0 supported
$CurrentVersion = (Get-CimInstance -Namespace root/cimv2/Security/MicrosoftTpm -ClassName Win32_Tpm).SpecVersion.Split(",").Trim() | Select-Object -First 1
switch ([System.Version]$CurrentVersion -lt [System.Version]"2.0")
{
@ -165,7 +165,11 @@ function Checkings
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# https://github.com/farag2/Sophia-Script-for-Windows/blob/master/sophia_script_versions.json
$LatestRelease = (Invoke-RestMethod -Uri "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/master/sophia_script_versions.json" -UseBasicParsing).Sophia_Script_Windows_11_PowerShell_5_1
$Parameters = @{
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/master/sophia_script_versions.json"
UseBasicParsing = $true
}
$LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerShell_5_1
$CurrentRelease = (Get-Module -Name Sophia).Version.ToString()
switch ([System.Version]$LatestRelease -gt [System.Version]$CurrentRelease)
{
@ -236,6 +240,9 @@ function Checkings
$Script:ControlledFolderAccess = $false
}
}
# Save all opened folders in order to restore them after File Explorer restart
$Script:OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke()
}
#endregion Checkings
@ -847,12 +854,12 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
Start-Sleep -Milliseconds 100
Start-Sleep -Seconds 1
# Force move the console window to the foreground
[WinAPI.ForegroundWindow]::SetForegroundWindow($_.MainWindowHandle)
Start-Sleep -Milliseconds 100
Start-Sleep -Seconds 1
# Emulate the Backspace key sending
[System.Windows.Forms.SendKeys]::SendWait("{BACKSPACE 1}")
@ -1483,9 +1490,6 @@ function ThisPC
.EXAMPLE
Windows10FileExplorer -Disable
.NOTES
Enabling the Windows 10 File Explorer will hide the "Share" item context menu
.NOTES
Current user
#>
@ -1512,33 +1516,15 @@ function Windows10FileExplorer
{
"Enable"
{
if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked"))
if (-not (Test-Path -Path "HKCU:\Software\Classes\CLSID\{d93ed569-3b3e-4bff-8355-3c44f6a52bb5}\InprocServer32"))
{
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Force
New-Item -Path "HKCU:\Software\Classes\CLSID\{d93ed569-3b3e-4bff-8355-3c44f6a52bb5}\InprocServer32" -Force
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -PropertyType String -Value "" -Force
New-ItemProperty -Path "HKCU:\Software\Classes\CLSID\{d93ed569-3b3e-4bff-8355-3c44f6a52bb5}\InprocServer32" -Name "(default)" -PropertyType String -Value "" -Force
}
"Disable"
{
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -Force -ErrorAction Ignore
}
}
# Save all opened folders in order to restore them after File Explorer restart
Clear-Variable -Name OpenedFolders -Force -ErrorAction Ignore
$OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke()
# In order for the changes to take effect the File Explorer process has to be restarted
Stop-Process -Name explorer -Force
Start-Sleep -Seconds 3
# Restoring closed folders
foreach ($OpenedFolder in $OpenedFolders)
{
if (Test-Path -Path $OpenedFolder)
{
Invoke-Item -Path $OpenedFolder
Remove-Item -Path "HKCU:\Software\Classes\CLSID\{d93ed569-3b3e-4bff-8355-3c44f6a52bb5}" -Recurse -Force -ErrorAction Ignore
}
}
}
@ -1738,11 +1724,11 @@ function MergeConflicts
{
"Show"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideMergeConflicts -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideMergeConflicts -PropertyType DWord -Value 0 -Force
}
"Hide"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideMergeConflicts -PropertyType DWord -Value 0 -Force
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideMergeConflicts -PropertyType DWord -Value 1 -Force
}
}
}
@ -2062,74 +2048,6 @@ function FileTransferDialog
}
}
<#
.SYNOPSIS
The Windows 10 File Explorer ribbon
.PARAMETER Expanded
Expand the Windows 10 File Explorer ribbon
.PARAMETER Minimized
Minimize the Windows 10 File Explorer ribbon
.EXAMPLE
Windows10FileExplorerRibbon -Expanded
.EXAMPLE
Windows10FileExplorerRibbon -Minimized
.NOTES
In order this feature to work you need to enable the Windows 10 File Explorer (Windows10FileExplorer -Enable)
.NOTES
Current user
#>
function Windows10FileExplorerRibbon
{
param
(
[Parameter(
Mandatory = $true,
ParameterSetName = "Expanded"
)]
[switch]
$Expanded,
[Parameter(
Mandatory = $true,
ParameterSetName = "Minimized"
)]
[switch]
$Minimized
)
switch ($PSCmdlet.ParameterSetName)
{
"Expanded"
{
if (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{e2bf9676-5f8f-435c-97eb-11607a5bedf7}" -ErrorAction Ignore)
{
if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon))
{
New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Force
}
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Name MinimizedStateTabletModeOff -PropertyType DWord -Value 0 -Force
}
}
"Minimized"
{
if (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{e2bf9676-5f8f-435c-97eb-11607a5bedf7}" -ErrorAction Ignore)
{
if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon))
{
New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Force
}
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Name MinimizedStateTabletModeOff -PropertyType DWord -Value 1 -Force
}
}
}
}
<#
.SYNOPSIS
The recycle bin files delete confirmation dialog
@ -3346,7 +3264,7 @@ function AeroShaking
Uninstall OneDrive
.PARAMETER Install
Install OneDrive
Install OneDrive 64-bit
.EXAMPLE
OneDrive -Uninstall
@ -3465,18 +3383,30 @@ public static bool MarkFileDelete (string sourcefile)
Remove-Item -Path HKLM:\SOFTWARE\WOW6432Node\Microsoft\OneDrive -Recurse -Force -ErrorAction Ignore
Remove-Item -Path "$env:ProgramData\Microsoft OneDrive" -Recurse -Force -ErrorAction Ignore
Remove-Item -Path $env:SystemDrive\OneDriveTemp -Recurse -Force -ErrorAction Ignore
Unregister-ScheduledTask -TaskName *OneDrive* -Confirm:$false
Unregister-ScheduledTask -TaskName *OneDrive* -Confirm:$false -ErrorAction Ignore
# Getting the OneDrive folder path
$OneDriveFolder = Split-Path -Path (Split-Path -Path $OneDriveSetup[0] -Parent)
# Save all opened folders in order to restore them after File Explorer restarting
Clear-Variable -Name OpenedFolders -Force -ErrorAction Ignore
$OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke()
$Script:OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke()
# Terminate the File Explorer process
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoRestartShell -Value 0 -Force
Stop-Process -Name explorer -Force
Start-Sleep -Seconds 3
# Restoring closed folders
foreach ($Script:OpenedFolder in $Script:OpenedFolders)
{
if (Test-Path -Path $Script:OpenedFolder)
{
Invoke-Item -Path $Script:OpenedFolder
}
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name AutoRestartShell -Value 1 -Force
# Attempt to unregister FileSyncShell64.dll and remove
@ -3528,20 +3458,29 @@ public static bool MarkFileDelete (string sourcefile)
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.OneDriveInstalling -Verbose
Start-Process -FilePath $env:SystemRoot\SysWOW64\OneDriveSetup.exe
}
else
{
try
{
# Downloading the latest OneDrive installer x64
if ((Invoke-WebRequest -Uri https://www.google.com -UseBasicParsing -DisableKeepAlive -Method Head).StatusDescription)
# Check the internet connection
$Parameters = @{
Uri = "https://www.google.com"
Method = "Head"
DisableKeepAlive = $true
UseBasicParsing = $true
}
if (-not (Invoke-WebRequest @Parameters).StatusDescription)
{
return
}
# Downloading the latest OneDrive installer 64-bit
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.OneDriveDownloading -Verbose
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Parse XML to get the URL
# https://go.microsoft.com/fwlink/p/?LinkID=844652
$Parameters = @{
@ -3559,12 +3498,14 @@ public static bool MarkFileDelete (string sourcefile)
$Parameters = @{
Uri = $OneDriveURL
OutFile = "$DownloadsFolder\OneDriveSetup.exe"
UseBasicParsing = $true
Verbose = $true
}
Invoke-WebRequest @Parameters
Start-Process -FilePath "$DownloadsFolder\OneDriveSetup.exe"
}
Start-Process -FilePath "$DownloadsFolder\OneDriveSetup.exe" -Wait
Remove-Item -Path "$DownloadsFolder\OneDriveSetup.exe" -Force
}
catch [System.Net.WebException]
{
@ -3572,8 +3513,6 @@ public static bool MarkFileDelete (string sourcefile)
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line) -ErrorAction SilentlyContinue
return
}
}
@ -4750,12 +4689,12 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
Start-Sleep -Milliseconds 100
Start-Sleep -Seconds 1
# Force move the console window to the foreground
[WinAPI.ForegroundWindow]::SetForegroundWindow($_.MainWindowHandle)
Start-Sleep -Milliseconds 100
Start-Sleep -Seconds 1
# Emulate the Backspace key sending
[System.Windows.Forms.SendKeys]::SendWait("{BACKSPACE 1}")
@ -5062,18 +5001,17 @@ function WindowsCapabilities
{
"Install"
{
# Check the internet connection
try
{
(Invoke-WebRequest -Uri https://www.google.com -UseBasicParsing -DisableKeepAlive -Method Head).StatusDescription
# Check the internet connection
$Parameters = @{
Uri = "https://www.google.com"
Method = "Head"
DisableKeepAlive = $true
UseBasicParsing = $true
}
catch [System.Net.WebException]
if (-not (Invoke-RestMethod @Parameters).StatusDescription)
{
Write-Warning -Message $Localization.NoInternetConnection
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line) -ErrorAction SilentlyContinue
return
}
@ -5081,6 +5019,14 @@ function WindowsCapabilities
$ButtonContent = $Localization.Install
$ButtonAdd_Click = {InstallButton}
}
catch [System.Net.WebException]
{
Write-Warning -Message $Localization.NoInternetConnection
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line) -ErrorAction SilentlyContinue
}
}
"Uninstall"
{
$State = "Installed"
@ -5139,12 +5085,12 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
Start-Sleep -Milliseconds 100
Start-Sleep -Seconds 1
# Force move the console window to the foreground
[WinAPI.ForegroundWindow]::SetForegroundWindow($_.MainWindowHandle)
Start-Sleep -Milliseconds 100
Start-Sleep -Seconds 1
# Emulate the Backspace key sending
[System.Windows.Forms.SendKeys]::SendWait("{BACKSPACE 1}")
@ -5428,14 +5374,26 @@ function IPv6Component
$Enable
)
# Check the internet connection
try
{
if ((Invoke-WebRequest -Uri https://www.google.com -UseBasicParsing -DisableKeepAlive -Method Head).StatusDescription)
# Check the internet connection
$Parameters = @{
Uri = "https://www.google.com"
Method = "Head"
DisableKeepAlive = $true
UseBasicParsing = $true
}
if (-not (Invoke-WebRequest @Parameters).StatusDescription)
{
return
}
# Check whether the ISP supports IPv6 protocol using https://ipv6-test.com
$IPv6Test = Invoke-RestMethod -Uri "https://v4v6.ipv6-test.com/api/myip.php?json" | Where-Object -FilterScript {$_.proto -eq "ipv6"}
$Parameters = @{
Uri = "https://v4v6.ipv6-test.com/api/myip.php?json"
UseBasicParsing = $true
}
$IPv6Test = Invoke-RestMethod @Parameters | Where-Object -FilterScript {$_.proto -eq "ipv6"}
}
catch [System.Net.WebException]
{
@ -5443,8 +5401,6 @@ function IPv6Component
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line) -ErrorAction SilentlyContinue
return
}
switch ($PSCmdlet.ParameterSetName)
@ -6567,31 +6523,13 @@ function WinPrtScrFolder
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{B7BEDE81-DF94-4682-A7D8-57A52620B86F}" -Force -ErrorAction Ignore
}
}
# Save all opened folders in order to restore them after File Explorer restart
Clear-Variable -Name OpenedFolders -Force -ErrorAction Ignore
$OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke()
# In order for the changes to take effect the File Explorer process has to be restarted
Stop-Process -Name explorer -Force
Start-Sleep -Seconds 3
# Restoring closed folders
foreach ($OpenedFolder in $OpenedFolders)
{
if (Test-Path -Path $OpenedFolder)
{
Start-Process -FilePath explorer -ArgumentList $OpenedFolder
}
}
}
<#
.SYNOPSIS
Recommended troubleshooter preferences
.PARAMETER Automatic
.PARAMETER Automatically
Run troubleshooter automatically, then notify me
.PARAMETER Default
@ -8178,12 +8116,12 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
Start-Sleep -Milliseconds 100
Start-Sleep -Seconds 1
# Force move the console window to the foreground
[WinAPI.ForegroundWindow]::SetForegroundWindow($_.MainWindowHandle)
Start-Sleep -Milliseconds 100
Start-Sleep -Seconds 1
# Emulate the Backspace key sending
[System.Windows.Forms.SendKeys]::SendWait("{BACKSPACE 1}")
@ -8533,7 +8471,8 @@ function UninstallUWPApps
# The Bundle packages contains no Microsoft Teams
if (Get-AppxPackage -Name MicrosoftTeams -AllUsers:$AllUsers)
{
$AppxPackages += Get-AppxPackage -Name MicrosoftTeams -AllUsers:$AllUsers
# Temporarily hack: due to the fact that there are actually two Microsoft Teams packages, we need to choose the first one to display
$AppxPackages += Get-AppxPackage -Name MicrosoftTeams -AllUsers:$AllUsers | Select-Object -Index 0
}
$PackagesIds = [Windows.Management.Deployment.PackageManager, Windows.Web, ContentType = WindowsRuntime]::new().FindPackages() | Select-Object -Property DisplayName -ExpandProperty Id | Select-Object -Property Name, DisplayName
@ -8744,12 +8683,12 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
Start-Sleep -Milliseconds 100
Start-Sleep -Seconds 1
# Force move the console window to the foreground
[WinAPI.ForegroundWindow]::SetForegroundWindow($_.MainWindowHandle)
Start-Sleep -Milliseconds 100
Start-Sleep -Seconds 1
# Emulate the Backspace key sending to prevent the console window to freeze
[System.Windows.Forms.SendKeys]::SendWait("{BACKSPACE 1}")
@ -8879,7 +8818,8 @@ function RestoreUWPApps
# 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"}
# Temporarily hack: due to the fact that there are actually two Microsoft Teams packages, we need to choose the first one to display
$AppxPackages += Get-AppxPackage -Name MicrosoftTeams -AllUsers | Where-Object -FilterScript {$_.PackageUserInformation -match "Staged"} | Select-Object -Index 0
}
$PackagesIds = [Windows.Management.Deployment.PackageManager, Windows.Web, ContentType = WindowsRuntime]::new().FindPackages() | Select-Object -Property DisplayName -ExpandProperty Id | Select-Object -Property Name, DisplayName
@ -9069,12 +9009,12 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)
Start-Sleep -Milliseconds 100
Start-Sleep -Seconds 1
# Force move the console window to the foreground
[WinAPI.ForegroundWindow]::SetForegroundWindow($_.MainWindowHandle)
Start-Sleep -Milliseconds 100
Start-Sleep -Seconds 1
# Emulate the Backspace key sending to prevent the console window to freeze
[System.Windows.Forms.SendKeys]::SendWait("{BACKSPACE 1}")
@ -9149,24 +9089,45 @@ function HEIF
try
{
# Check the internet connection
if ((Invoke-WebRequest -Uri https://www.google.com -UseBasicParsing -DisableKeepAlive -Method Head).StatusDescription)
$Parameters = @{
Uri = "https://www.google.com"
Method = "Head"
DisableKeepAlive = $true
UseBasicParsing = $true
}
if (-not (Invoke-WebRequest @Parameters).StatusDescription)
{
return
}
try
{
# Check whether the https://store.rg-adguard.net site is alive
if ((Invoke-WebRequest -Uri https://store.rg-adguard.net/api/GetFiles -UseBasicParsing -DisableKeepAlive -Method Head).StatusDescription)
$Parameters = @{
Uri = "https://store.rg-adguard.net/api/GetFiles"
Method = "Head"
DisableKeepAlive = $true
UseBasicParsing = $true
}
if (-not (Invoke-RestMethod @Parameters).StatusDescription)
{
$API = "https://store.rg-adguard.net/api/GetFiles"
# HEVC Video Extensions from Device Manufacturer
$ProductURL = "https://www.microsoft.com/store/productId/9n4wgh0z6vhq"
return
}
$Body = @{
$Parameters = @{
Method = "Post"
Uri = "https://store.rg-adguard.net/api/GetFiles"
ContentType = "application/x-www-form-urlencoded"
Body = @{
type = "url"
url = $ProductURL
# HEVC Video Extensions from Device Manufacturer
url = "https://www.microsoft.com/store/productId/9n4wgh0z6vhq"
ring = "Retail"
lang = "en-US"
}
$Raw = Invoke-RestMethod -Method Post -Uri $API -ContentType 'application/x-www-form-urlencoded' -Body $Body
UseBasicParsing = $true
}
$Raw = Invoke-WebRequest @Parameters
# Parsing the page
$Raw | Select-String -Pattern '<tr style.*<a href=\"(?<url>.*)"\s.*>(?<text>.*)<\/a>' -AllMatches | ForEach-Object -Process {$_.Matches} | ForEach-Object -Process {
@ -9178,12 +9139,11 @@ function HEIF
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.HEVCDownloading -Verbose
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}"
$Parameters = @{
Uri = $TempURL
OutFile = "$DownloadsFolder\$Package"
UseBasicParsing = $true
Verbose = $true
}
Invoke-WebRequest @Parameters
@ -9195,13 +9155,12 @@ function HEIF
}
}
}
}
catch [System.Net.WebException]
{
Write-Warning -Message ($Localization.NoResponse -f "https://store.rg-adguard.net")
Write-Error -Message ($Localization.NoResponse -f "https://store.rg-adguard.net") -ErrorAction SilentlyContinue
return
}
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line) -ErrorAction SilentlyContinue
}
}
catch [System.Net.WebException]
@ -9210,8 +9169,6 @@ function HEIF
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line) -ErrorAction SilentlyContinue
return
}
}
}
@ -9221,10 +9178,19 @@ function HEIF
{
try
{
if ((Invoke-WebRequest -Uri https://www.google.com -UseBasicParsing -DisableKeepAlive -Method Head).StatusDescription)
# Check the internet connection
$Parameters = @{
Uri = "https://www.google.com"
Method = "Head"
DisableKeepAlive = $true
UseBasicParsing = $true
}
if (-not (Invoke-WebRequest @Parameters).StatusDescription)
{
Start-Process -FilePath ms-windows-store://pdp/?ProductId=9n4wgh0z6vhq
return
}
Start-Process -FilePath ms-windows-store://pdp/?ProductId=9n4wgh0z6vhq
}
catch [System.Net.WebException]
{
@ -9232,8 +9198,6 @@ function HEIF
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line) -ErrorAction SilentlyContinue
return
}
}
}
@ -9820,8 +9784,8 @@ while (`$true)
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel" -Name ShowInActionCenter -Force -ErrorAction Ignore
Unregister-ScheduledTask -TaskName "Windows Cleanup" -Confirm:$false
Unregister-ScheduledTask -TaskName "Windows Cleanup Notification" -Confirm:$false
Unregister-ScheduledTask -TaskName "Windows Cleanup" -Confirm:$false -ErrorAction Ignore
Unregister-ScheduledTask -TaskName "Windows Cleanup Notification" -Confirm:$false -ErrorAction Ignore
Remove-Item -Path Registry::HKEY_CLASSES_ROOT\WindowsCleanup -Recurse -Force -ErrorAction Ignore
}
@ -9928,7 +9892,7 @@ Get-ChildItem -Path `$env:SystemRoot\SoftwareDistribution\Download -Recurse -For
}
"Delete"
{
Unregister-ScheduledTask -TaskName SoftwareDistribution -Confirm:$false
Unregister-ScheduledTask -TaskName SoftwareDistribution -Confirm:$false -ErrorAction Ignore
}
}
}
@ -10025,7 +9989,7 @@ Get-ChildItem -Path `$env:TEMP -Recurse -Force | Where-Object {`$_.CreationTime
}
"Delete"
{
Unregister-ScheduledTask -TaskName Temp -Confirm:$false
Unregister-ScheduledTask -TaskName Temp2 -Confirm:$false -ErrorAction Ignore
}
}
}
@ -11653,13 +11617,13 @@ function UseStoreOpenWith
<#
.SYNOPSIS
The "Open in Windows Terminal" menu option in the context menu
The "Open in Windows Terminal" item in the context menu
.PARAMETER Hide
Hide the "Open in Windows Terminal" menu option in the folders context menu
Hide the "Open in Windows Terminal" item in the folders context menu
.PARAMETER Show
Show the "Open in Windows Terminal" menu option in the folders context menu
Show the "Open in Windows Terminal" item in the folders context menu
.EXAMPLE
OpenWindowsTerminalContext -Hide
@ -11711,6 +11675,122 @@ function OpenWindowsTerminalContext
}
}
}
<#
.SYNOPSIS
The "Open in Windows Terminal as administrator" item in the context menu
.PARAMETER Show
Show the "Open in Windows Terminal (Admin)" item in the Desktop and folders context menu
.PARAMETER Hide
Hide the "Open in Windows Terminal (Admin)" item from the Desktop and folders context menu
.EXAMPLE
OpenWindowsTerminalAdminContext -Show
.EXAMPLE
OpenWindowsTerminalAdminContext -Hide
.NOTES
Current user
#>
function OpenWindowsTerminalAdminContext
{
param
(
[Parameter(
Mandatory = $true,
ParameterSetName = "Show"
)]
[switch]
$Show,
[Parameter(
Mandatory = $true,
ParameterSetName = "Hide"
)]
[switch]
$Hide
)
switch ($PSCmdlet.ParameterSetName)
{
"Show"
{
if (Get-AppxPackage -Name Microsoft.WindowsTerminal)
{
try
{
# Check the internet connection
$Parameters = @{
Uri = "https://www.google.com"
Method = "Head"
DisableKeepAlive = $true
UseBasicParsing = $true
}
if (-not (Invoke-WebRequest @Parameters).StatusDescription)
{
return
}
$Parameters = @{
Uri = "https://raw.githubusercontent.com/microsoft/terminal/master/res/terminal.ico"
OutFile = "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\terminal.ico"
UseBasicParsing = $true
Verbose = $true
}
Invoke-WebRequest @Parameters
}
catch [System.Net.WebException]
{
Write-Warning -Message $Localization.NoInternetConnection
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line) -ErrorAction SilentlyContinue
}
# Show the option in the Desktop context menu
if (-not (Test-Path -Path HKLM:\SOFTWARE\Classes\Directory\Background\shell\OpenWTHereAsAdmin\command))
{
New-Item -Path HKLM:\SOFTWARE\Classes\Directory\Background\shell\OpenWTHereAsAdmin\command -ItemType Directory -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\Directory\Background\shell\OpenWTHereAsAdmin -Name "(default)" -PropertyType String -Value $Localization.OpenInWindowsTerminalAdmin -Force
if (Test-Path -Path "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\terminal.ico")
{
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\Directory\Background\shell\OpenWTHereAsAdmin -Name Icon -PropertyType String -Value "%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\terminal.ico" -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\Directory\Background\shell\OpenWTHereAsAdmin -Name NoWorkingDirectory -PropertyType String -Value "" -Force
$Value = "powershell.exe Start-Process -FilePath wt.exe -ArgumentList '-d `"`"`"%V`"`"`"' -Verb RunAs"
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWTHereAsAdmin\command -Name "(default)" -PropertyType String -Value $Value -Force
# Show the option in the folders context menu
if (-not (Test-Path -Path HKLM:\SOFTWARE\Classes\Directory\shell\OpenWTHereAsAdmin\command))
{
New-Item -Path HKLM:\SOFTWARE\Classes\Directory\shell\OpenWTHereAsAdmin\command -ItemType Directory -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\Directory\shell\OpenWTHereAsAdmin -Name "(default)" -PropertyType String -Value $Localization.OpenInWindowsTerminalAdmin -Force
if (Test-Path -Path "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\terminal.ico")
{
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\Directory\shell\OpenWTHereAsAdmin -Name Icon -PropertyType String -Value "%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\terminal.ico" -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Classes\Directory\shell\OpenWTHereAsAdmin -Name NoWorkingDirectory -PropertyType String -Value "" -Force
$Value = "powershell.exe Start-Process -FilePath wt.exe -ArgumentList '-d `"`"`"%1`"`"`"' -Verb RunAs"
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Directory\shell\OpenWTHereAsAdmin\command -Name "(default)" -PropertyType String -Value $Value -Force
}
}
"Hide"
{
if (Get-AppxPackage -Name Microsoft.WindowsTerminal)
{
Remove-Item -Path Registry::HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWTHereAsAdmin -Recurse -Force -ErrorAction Ignore
Remove-Item -Path Registry::HKEY_CLASSES_ROOT\Directory\shell\OpenWTHereAsAdmin -Recurse -Force -ErrorAction Ignore
Remove-Item -Path "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\terminal.ico" -Force -ErrorAction Ignore
}
}
}
}
#endregion Context menu
#region Refresh Environment
@ -11781,6 +11861,38 @@ public static void PostMessage()
Set-MpPreference -EnableControlledFolderAccess Enabled
}
# In order for the changes to take effect the File Explorer process has to be restarted
$Title = ""
$Message = $Localization.FileExplorerRestartPrompt
$Yes = $Localization.Yes
$No = $Localization.No
$Options = "&$No", "&$Yes"
$DefaultChoice = 1
$Result = $Host.UI.PromptForChoice($Title, $Message, $Options, $DefaultChoice)
switch ($Result)
{
"0"
{
continue
}
"1"
{
Stop-Process -Name explorer -Force
Start-Sleep -Seconds 3
# Restoring closed folders
foreach ($Script:OpenedFolder in $Script:OpenedFolders)
{
if (Test-Path -Path $Script:OpenedFolder)
{
Invoke-Item -Path $Script:OpenedFolder
}
}
}
}
Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.RestartWarning

44
Sophia Script/Sophia Script for Windows 11/Sophia.ps1

@ -2,8 +2,8 @@
.SYNOPSIS
Default preset file for "Sophia Script for Windows 11"
Version: v6.0.4
Date: 19.09.2021
Version: v6.0.5
Date: 05.10.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
@ -21,7 +21,7 @@
.EXAMPLE Run the script by specifying the module functions as an argument
.\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
.EXAMPLE Download and expand the latest Sophia Script version archive (without running) according which Windows and PowerShell versions it is run on
irm script.sophi.app | iex
Invoke-RestMethod -Uri script.sophi.app | Invoke-Expression
@ -71,7 +71,7 @@ param
Clear-Host
$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"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.0.5 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014–2021"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force
@ -230,7 +230,7 @@ AppsSilentInstalling -Disable
# Не показывать предложения по настройке устройства
WhatsNewInWindows -Disable
# Let Microsoft offer you tailored expereinces based on the diagnostic data setting you hava chosen (default value)
# Let Microsoft offer you tailored expereinces based on the diagnostic data setting you have chosen (default value)
# Разрешите корпорации Майкософт использовать ваши диагностические данные для улучшения вашей работы со службами Майкрософт с помощью персонализированных советов, рекламы и рекомендаций (значение по умолчанию)
# WhatsNewInWindows -Enable
@ -353,24 +353,6 @@ FileTransferDialog -Detailed
# Отображать диалоговое окно передачи файлов в свернутом виде (значение по умолчанию)
# FileTransferDialog -Compact
<#
Expand 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 -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
# Запрашивать подтверждение на удаление файлов в корзину
RecycleBinDeleteConfirmation -Enable
@ -553,8 +535,8 @@ AeroShaking -Enable
# Удалить OneDrive. Папка пользователя OneDrive не будет удалена
OneDrive -Uninstall
# Install OneDrive (default value)
# Установить OneDrive (значение по умолчанию)
# Install OneDrive 64-bit (default value)
# Установить OneDrive 64-бит (значение по умолчанию)
# OneDrive -Install
#endregion OneDrive
@ -1328,13 +1310,21 @@ UseStoreOpenWith -Hide
# Отобразить пункт "Поиск приложения в Microsoft Store" в диалоге "Открыть с помощью" (значение по умолчанию)
# UseStoreOpenWith -Show
# Hide the "Open in Windows Terminal" menu option in the folders context menu
# Hide the "Open in Windows Terminal" item in the folders context menu
# Скрыть пункт "Открыть в Терминале Windows" в контекстном меню папок
OpenWindowsTerminalContext -Hide
# Show the "Open in Windows Terminal" menu option in the folders context menu (default value)
# Show the "Open in Windows Terminal" item in the folders context menu (default value)
# Отобразить пункт "Открыть в Терминале Windows" в контекстном меню папок (значение по умолчанию)
# OpenWindowsTerminalContext -Show
# Show the "Open in Windows Terminal (Admin)" item in the Desktop and folders context menu
# Отобразить пункт "Открыть в Терминале Windows (Администратор)" в контекстном меню Рабочего стола и папок (значение по умолчанию)
OpenWindowsTerminalAdminContext -Show
# Hide the "Open in Windows Terminal (Admin)" item from the Desktop and folders context menu (default value)
# Скрыть пункт "Открыть в Терминале Windows (Администратор)" в контекстном меню Рабочего стола и папок (значение по умолчанию)
# OpenWindowsTerminalAdminContext -Hide
#endregion Context menu
<#

Loading…
Cancel
Save