Skip to content

Commit

Permalink
6.1.2 — 16.07.2022
Browse files Browse the repository at this point in the history
  • Loading branch information
farag2 committed Jul 15, 2022
1 parent 0828558 commit 228df70
Show file tree
Hide file tree
Showing 37 changed files with 684 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.SYNOPSIS
The TAB completion for functions and their arguments
Version: v5.3.1
Date: 05.07.2022
Version: v5.3.2
Date: 16.07.2022
Copyright (c) 2014—2022 farag
Copyright (c) 2019—2022 farag & Inestic
Expand Down Expand Up @@ -54,7 +54,7 @@ function Sophia

Clear-Host

$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2019 v5.3.1 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2019 v5.3.2 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"

Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '5.3.1'
ModuleVersion = '5.3.2'
GUID = 'a36a65ca-70f9-43df-856c-3048fc5e7f01'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v5.3.1
Date: 05.07.2022
Version: v5.3.2
Date: 16.07.2022
Copyright (c) 2014—2022 farag
Copyright (c) 2019—2022 farag & Inestic
Expand Down Expand Up @@ -304,11 +304,62 @@ function Checkings
}
}

#region Defender Checkings
# Turn off Controlled folder access to let the script proceed
# Checking whether Defender wasn't disabled first
$productState = (Get-CimInstance -Namespace root/SecurityCenter2 -ClassName Antivirusproduct | Where-Object -FilterScript {$_.instanceGuid -eq "{D68DDC3A-831F-4fae-9E44-DA132C1ACF46}"}).productState
$DefenderState = ('0x{0:x}' -f $productState).Substring(3, 2)
if ($DefenderState -notmatch "00|01")
{
$Script:DefenderproductState = $true
}
else
{
$Script:DefenderproductState = $false
}

# Checking services
Get-Service -Name Windefend, SecurityHealthService, wscsvc -ErrorAction Ignore | ForEach-Object -Process {
if (($null -ne $_.Name) -and ($_.Status -eq "running"))
{
$Script:DefenderServices = $true
}
else
{
$Script:DefenderServices = $false
}
}

if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).AntispywareEnabled)
{
$Script:DefenderAntispywareEnabled = $true
}
else
{
$Script:DefenderAntispywareEnabled = $false
}

# https://docs.microsoft.com/en-us/graph/api/resources/intune-devices-windowsdefenderproductstatus?view=graph-rest-beta
if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).ProductStatus -eq 1)
{
$Script:DefenderProductStatus = $false
}
else
{
$Script:DefenderProductStatus = $true
}

# https://docs.microsoft.com/en-us/graph/api/resources/intune-devices-windowsdefenderproductstatus?view=graph-rest-beta
if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).AMEngineVersion -eq 0.0.0.0)
{
$Script:DefenderAMEngineVersion = $false
}
else
{
$Script:DefenderAMEngineVersion = $true
}

if ($Script:DefenderproductState -and $Script:DefenderServices -and $Script:DefenderAntispywareEnabled -and $Script:DefenderProductStatus -and $Script:DefenderAMEngineVersion)
{
# Defender is enabled
$Script:DefenderState = $true
Expand All @@ -331,6 +382,7 @@ function Checkings
}
}
}
#endregion Defender Checkings

# 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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.SYNOPSIS
Default preset file for "Sophia Script for Windows 10 LTSC 2019"
Version: v5.3.1
Date: 05.07.2022
Version: v5.3.2
Date: 16.07.2022
Copyright (c) 2014—2022 farag
Copyright (c) 2019—2022 farag & Inestic
Expand Down Expand Up @@ -71,7 +71,7 @@ param

Clear-Host

$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2019 v5.3.1 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2019 v5.3.2 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"

Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.SYNOPSIS
The TAB completion for functions and their arguments
Version: v5.13.1
Date: 05.07.2022
Version: v5.13.2
Date: 16.07.2022
Copyright (c) 2014—2022 farag
Copyright (c) 2019—2022 farag & Inestic
Expand Down Expand Up @@ -54,7 +54,7 @@ function Sophia

Clear-Host

$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2021 v5.13.1 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2021 v5.13.2 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"

Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '5.13.1'
ModuleVersion = '5.13.2'
GUID = '109cc881-c42b-45af-a74a-550781989d6a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v5.13.1
Date: 05.07.2022
Version: v5.13.2
Date: 16.07.2022
Copyright (c) 2014—2022 farag
Copyright (c) 2019—2022 farag & Inestic
Expand All @@ -15,9 +15,9 @@
.NOTES
Supported Windows 10 version
Versions: 21H2
Builds: 19044.1766+
Editions: Enterprise LTSC 2021
Version: 21H2
Build: 19044.1766+
Edition: Enterprise LTSC 2021
Architecture: x64
.NOTES
Expand Down Expand Up @@ -304,11 +304,62 @@ function Checkings
}
}

#region Defender Checkings
# Turn off Controlled folder access to let the script proceed
# Checking whether Defender wasn't disabled first
$productState = (Get-CimInstance -Namespace root/SecurityCenter2 -ClassName Antivirusproduct | Where-Object -FilterScript {$_.instanceGuid -eq "{D68DDC3A-831F-4fae-9E44-DA132C1ACF46}"}).productState
$DefenderState = ('0x{0:x}' -f $productState).Substring(3, 2)
if ($DefenderState -notmatch "00|01")
{
$Script:DefenderproductState = $true
}
else
{
$Script:DefenderproductState = $false
}

# Checking services
Get-Service -Name Windefend, SecurityHealthService, wscsvc -ErrorAction Ignore | ForEach-Object -Process {
if (($null -ne $_.Name) -and ($_.Status -eq "running"))
{
$Script:DefenderServices = $true
}
else
{
$Script:DefenderServices = $false
}
}

if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).AntispywareEnabled)
{
$Script:DefenderAntispywareEnabled = $true
}
else
{
$Script:DefenderAntispywareEnabled = $false
}

# https://docs.microsoft.com/en-us/graph/api/resources/intune-devices-windowsdefenderproductstatus?view=graph-rest-beta
if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).ProductStatus -eq 1)
{
$Script:DefenderProductStatus = $false
}
else
{
$Script:DefenderProductStatus = $true
}

# https://docs.microsoft.com/en-us/graph/api/resources/intune-devices-windowsdefenderproductstatus?view=graph-rest-beta
if ((Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/microsoft/windows/defender).AMEngineVersion -eq 0.0.0.0)
{
$Script:DefenderAMEngineVersion = $false
}
else
{
$Script:DefenderAMEngineVersion = $true
}

if ($Script:DefenderproductState -and $Script:DefenderServices -and $Script:DefenderAntispywareEnabled -and $Script:DefenderProductStatus -and $Script:DefenderAMEngineVersion)
{
# Defender is enabled
$Script:DefenderState = $true
Expand All @@ -331,6 +382,7 @@ function Checkings
}
}
}
#endregion Defender Checkings

# 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()
Expand Down Expand Up @@ -928,7 +980,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Add-Type @SetForegroundWindow
}

Get-Process | Where-Object -FilterScript {(($_.ProcessName -eq "powershell") -or ($_.ProcessName -eq "WindowsTerminal")) -and ($_.MainWindowTitle -match "Sophia Script for Windows 10 LTSC")} | ForEach-Object -Process {
Get-Process | Where-Object -FilterScript {($_.ProcessName -eq "powershell") -and ($_.MainWindowTitle -match "Sophia Script for Windows 10 LTSC")} | ForEach-Object -Process {
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)

Expand Down Expand Up @@ -4133,7 +4185,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Add-Type @SetForegroundWindow
}

Get-Process | Where-Object -FilterScript {(($_.ProcessName -eq "powershell") -or ($_.ProcessName -eq "WindowsTerminal")) -and ($_.MainWindowTitle -match "Sophia Script for Windows 10")} | ForEach-Object -Process {
Get-Process | Where-Object -FilterScript {($_.ProcessName -eq "powershell") -and ($_.MainWindowTitle -match "Sophia Script for Windows 10 LTSC")} | ForEach-Object -Process {
# Show window, if minimized
[WinAPI.ForegroundWindow]::ShowWindowAsync($_.MainWindowHandle, 10)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.SYNOPSIS
Default preset file for "Sophia Script for Windows 10 LTSC 2021"
Version: v5.13.1
Date: 05.07.2022
Version: v5.13.2
Date: 16.07.2022
Copyright (c) 2014—2022 farag
Copyright (c) 2019—2022 farag & Inestic
Expand All @@ -25,7 +25,7 @@
irm script.sophi.app -useb | iex
.NOTES
Supported Windows 10 versions
Supported Windows 10 version
Version: 21H2
Build: 19044.1766+
Edition: Enterprise LTSC 2021
Expand Down Expand Up @@ -71,7 +71,7 @@ param

Clear-Host

$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2021 v5.13.1 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2021 v5.13.2 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"

Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.SYNOPSIS
The TAB completion for functions and their arguments
Version: v5.13.1
Date: 05.07.2022
Version: v5.13.2
Date: 16.07.2022
Copyright (c) 2014—2022 farag
Copyright (c) 2019—2022 farag & Inestic
Expand Down Expand Up @@ -54,7 +54,7 @@ function Sophia

Clear-Host

$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.13.1 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.13.2 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"

Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '5.13.1'
ModuleVersion = '5.13.2'
GUID = 'aa0b47a7-1770-4b5d-8c9f-cc6c505bcc7a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'
Expand Down
Loading

0 comments on commit 228df70

Please sign in to comment.