@ -2,8 +2,8 @@
. SYNOPSIS
" Windows 10 Sophia Script " ( LTSC version ) is a PowerShell module for Windows 10 fine-tuning and automating the routine tasks
Version : v5 . 2 . 6
Date : 0 1. 06 . 2021
Version : v5 . 2 . 7
Date : 13 . 06 . 2021
Copyright ( c ) 2014 – 2021 farag
Copyright ( c ) 2019 – 2021 farag & Inestic
@ -137,7 +137,7 @@ function Checkings
{
" 0 "
{
Invoke-Item -Path $PSScriptRoot \ Sophia . ps1
Invoke-Item -Path $PSScriptRoot \ . . \ Sophia . ps1
exit
}
" 1 "
@ -2632,11 +2632,11 @@ function StorageSense
. SYNOPSIS
Configure Storage Sense running
. PARAMETER Disable
Run Storage Sense every month / during low free disk space
. PARAMETER Month
Run Storage Sense every month
. PARAMETER Enable
Run Storage Sense every month / during low free disk space
. PARAMETER Default
Run Storage Sense during low free disk space
. EXAMPLE
StorageSenseFrequency -Month
@ -4583,14 +4583,14 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
Add-Type @Signature
}
foreach ( $guid in $KnownFolders [ $KnownFolder ] )
foreach ( $GUID in $KnownFolders [ $KnownFolder ] )
{
[WinAPI.KnownFolders] :: SHSetKnownFolderPath ( [ref] $guid , 0 , 0 , $Path )
[WinAPI.KnownFolders] :: SHSetKnownFolderPath ( [ref] $GUID , 0 , 0 , $Path )
}
( Get-Item -Path $Path -Force ) . Attributes = " ReadOnly "
}
$UserShellFoldersRegName = @ {
$UserShellFoldersRegistry Names = @ {
" Desktop " = " Desktop "
" Documents " = " Personal "
" Downloads " = " {374DE290-123F-4565-9164-39C4925E467B} "
@ -4599,7 +4599,7 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
" Videos " = " My Video "
}
$UserShellFoldersGUID = @ {
$UserShellFoldersGUIDs = @ {
" Desktop " = " {754AC886-DF64-4CBA-86B5-F7FBF4FBCEF5} "
" Documents " = " {F42EE2D3-909F-4907-8871-4C22FC0BF756} "
" Downloads " = " {7D83EE9B-2244-4E70-B1F5-5393042AF1E4} "
@ -4644,12 +4644,12 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
}
# Determining the current user folder path
$UserShellFolderRegValue = Get-ItemPropertyValue -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name $UserShellFoldersRegName [ $UserFolder ]
if ( $UserShellFolderRegValue -ne $FolderPath )
$UserShellFolderRegistry Value = Get-ItemPropertyValue -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name $UserShellFoldersRegistry Names [ $UserFolder ]
if ( $UserShellFolderRegistry Value -ne $FolderPath )
{
if ( ( Get-ChildItem -Path $UserShellFolderRegValue | Measure-Object ) . Count -ne 0 )
if ( ( Get-ChildItem -Path $UserShellFolderRegistry Value | Measure-Object ) . Count -ne 0 )
{
Write-Error -Message ( $Localization . UserShellFolderNotEmpty -f $UserShellFolderRegValue ) -ErrorAction SilentlyContinue
Write-Error -Message ( $Localization . UserShellFolderNotEmpty -f $UserShellFolderRegistry Value ) -ErrorAction SilentlyContinue
}
# Creating a new folder if there is no one
@ -4661,11 +4661,11 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Removing old desktop.ini
if ( $RemoveDesktopINI . IsPresent )
{
Remove-Item -Path " $ UserShellFolderRegValue\desktop.ini " -Force
Remove-Item -Path " $ UserShellFolderRegistry Value\desktop.ini " -Force
}
KnownFolderPath -KnownFolder $UserFolder -Path $FolderPath
New-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name $UserShellFoldersGUID [ $UserFolder ] -PropertyType ExpandString -Value $FolderPath -Force
New-ItemProperty -Path " HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name $UserShellFoldersGUIDs [ $UserFolder ] -PropertyType ExpandString -Value $FolderPath -Force
# Save desktop.ini in the UTF-16 LE encoding
Set-Content -Path " $ FolderPath\desktop.ini " -Value $DesktopINI [ $UserFolder ] -Encoding Unicode -Force
@ -4958,9 +4958,9 @@ public static string GetString(uint strId)
$Title = " "
$Message = $Localization . UserFolderSelect -f $DesktopLocalizedString
$Select = $Localization . Select
$Select = $Localization . Browse
$Skip = $Localization . Skip
$Options = " & $ Select " , " & $ Skip "
$Options = " & $ Browse " , " & $ Skip "
$DefaultChoice = 1
$Result = $Host . UI . PromptForChoice ( $Title , $Message , $Options , $DefaultChoice )
@ -4994,9 +4994,9 @@ public static string GetString(uint strId)
$Title = " "
$Message = $Localization . UserFolderSelect -f $DocumentsLocalizedString
$Select = $Localization . Select
$Select = $Localization . Browse
$Skip = $Localization . Skip
$Options = " & $ Select " , " & $ Skip "
$Options = " & $ Browse " , " & $ Skip "
$DefaultChoice = 1
$Result = $Host . UI . PromptForChoice ( $Title , $Message , $Options , $DefaultChoice )
@ -5030,9 +5030,9 @@ public static string GetString(uint strId)
$Title = " "
$Message = $Localization . UserFolderSelect -f $DownloadsLocalizedString
$Select = $Localization . Select
$Select = $Localization . Browse
$Skip = $Localization . Skip
$Options = " & $ Select " , " & $ Skip "
$Options = " & $ Browse " , " & $ Skip "
$DefaultChoice = 1
$Result = $Host . UI . PromptForChoice ( $Title , $Message , $Options , $DefaultChoice )
@ -5066,9 +5066,9 @@ public static string GetString(uint strId)
$Title = " "
$Message = $Localization . UserFolderSelect -f $MusicLocalizedString
$Select = $Localization . Select
$Select = $Localization . Browse
$Skip = $Localization . Skip
$Options = " & $ Select " , " & $ Skip "
$Options = " & $ Browse " , " & $ Skip "
$DefaultChoice = 1
$Result = $Host . UI . PromptForChoice ( $Title , $Message , $Options , $DefaultChoice )
@ -5102,9 +5102,9 @@ public static string GetString(uint strId)
$Title = " "
$Message = $Localization . UserFolderSelect -f $PicturesLocalizedString
$Select = $Localization . Select
$Select = $Localization . Browse
$Skip = $Localization . Skip
$Options = " & $ Select " , " & $ Skip "
$Options = " & $ Browse " , " & $ Skip "
$DefaultChoice = 1
$Result = $Host . UI . PromptForChoice ( $Title , $Message , $Options , $DefaultChoice )
@ -5138,9 +5138,9 @@ public static string GetString(uint strId)
$Title = " "
$Message = $Localization . UserFolderSelect -f $VideosLocalizedString
$Select = $Localization . Select
$Select = $Localization . Browse
$Skip = $Localization . Skip
$Options = " & $ Select " , " & $ Skip "
$Options = " & $ Browse " , " & $ Skip "
$DefaultChoice = 1
$Result = $Host . UI . PromptForChoice ( $Title , $Message , $Options , $DefaultChoice )