Browse Source

Fixed bug in NetworkAdaptersSavePower

pull/429/head
Dmitry Nefedov 2 years ago
parent
commit
0b80a5428a
  1. 6
      src/Sophia_Script_for_Windows_10/Functions.ps1
  2. 2
      src/Sophia_Script_for_Windows_10/Manifest/Sophia.psd1
  3. 9
      src/Sophia_Script_for_Windows_10/Module/Sophia.psm1
  4. 6
      src/Sophia_Script_for_Windows_10/Sophia.ps1
  5. 2
      src/Sophia_Script_for_Windows_10_LTSC_2019/Functions.ps1
  6. 7
      src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1
  7. 2
      src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1
  8. 6
      src/Sophia_Script_for_Windows_10_LTSC_2021/Functions.ps1
  9. 2
      src/Sophia_Script_for_Windows_10_LTSC_2021/Manifest/Sophia.psd1
  10. 9
      src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1
  11. 6
      src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1
  12. 6
      src/Sophia_Script_for_Windows_10_PowerShell_7/Functions.ps1
  13. 2
      src/Sophia_Script_for_Windows_10_PowerShell_7/Manifest/Sophia.psd1
  14. 9
      src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1
  15. 6
      src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1
  16. 6
      src/Sophia_Script_for_Windows_11/Functions.ps1
  17. 2
      src/Sophia_Script_for_Windows_11/Manifest/Sophia.psd1
  18. 21
      src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
  19. 6
      src/Sophia_Script_for_Windows_11/Sophia.ps1
  20. 2
      src/Sophia_Script_for_Windows_11_PowerShell_7/Functions.ps1
  21. 9
      src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1
  22. 2
      src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1

6
src/Sophia_Script_for_Windows_10/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: v5.14.3 Version: v5.14.4
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic
@ -50,7 +50,7 @@ function Sophia
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.14.3 | 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.14.4 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
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
src/Sophia_Script_for_Windows_10/Manifest/Sophia.psd1

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

9
src/Sophia_Script_for_Windows_10/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: v5.14.3 Version: v5.14.4
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic
@ -6252,8 +6252,6 @@ function NetworkAdaptersSavePower
$Enable $Enable
) )
Write-Verbose -Message $Localization.Patient -Verbose
if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}) if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"})
{ {
$PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name) $PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name)
@ -6287,10 +6285,9 @@ function NetworkAdaptersSavePower
{ {
while while
( (
Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | ForEach-Object -Process {$_.Status -eq "Disconnected"} Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | Where-Object -FilterScript {$_.Status -eq "Disconnected"}
) )
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose Write-Verbose -Message $Localization.Patient -Verbose
Start-Sleep -Seconds 2 Start-Sleep -Seconds 2
} }

6
src/Sophia_Script_for_Windows_10/Sophia.ps1

@ -2,8 +2,8 @@
.SYNOPSIS .SYNOPSIS
Default preset file for "Sophia Script for Windows 10" Default preset file for "Sophia Script for Windows 10"
Version: v5.14.3 Version: v5.14.4
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic
@ -70,7 +70,7 @@ param
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.14.3 | 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.14.4 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
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
src/Sophia_Script_for_Windows_10_LTSC_2019/Functions.ps1

@ -3,7 +3,7 @@
The TAB completion for functions and their arguments The TAB completion for functions and their arguments
Version: v5.4.3 Version: v5.4.3
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic

7
src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1

@ -3,7 +3,7 @@
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: v5.4.3 Version: v5.4.3
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic
@ -4957,8 +4957,6 @@ function NetworkAdaptersSavePower
$Enable $Enable
) )
Write-Verbose -Message $Localization.Patient -Verbose
if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}) if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"})
{ {
$PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name) $PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name)
@ -4992,10 +4990,9 @@ function NetworkAdaptersSavePower
{ {
while while
( (
Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | ForEach-Object -Process {$_.Status -eq "Disconnected"} Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | Where-Object -FilterScript {$_.Status -eq "Disconnected"}
) )
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose Write-Verbose -Message $Localization.Patient -Verbose
Start-Sleep -Seconds 2 Start-Sleep -Seconds 2
} }

2
src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1

@ -3,7 +3,7 @@
Default preset file for "Sophia Script for Windows 10 LTSC 2019" Default preset file for "Sophia Script for Windows 10 LTSC 2019"
Version: v5.4.3 Version: v5.4.3
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic

6
src/Sophia_Script_for_Windows_10_LTSC_2021/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: v5.14.3 Version: v5.14.4
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic
@ -50,7 +50,7 @@ function Sophia
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2021 v5.14.3 | 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.14.4 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
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
src/Sophia_Script_for_Windows_10_LTSC_2021/Manifest/Sophia.psd1

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

9
src/Sophia_Script_for_Windows_10_LTSC_2021/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: v5.14.3 Version: v5.14.4
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic
@ -5344,8 +5344,6 @@ function NetworkAdaptersSavePower
$Enable $Enable
) )
Write-Verbose -Message $Localization.Patient -Verbose
if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}) if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"})
{ {
$PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name) $PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name)
@ -5379,10 +5377,9 @@ function NetworkAdaptersSavePower
{ {
while while
( (
Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | ForEach-Object -Process {$_.Status -eq "Disconnected"} Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | Where-Object -FilterScript {$_.Status -eq "Disconnected"}
) )
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose Write-Verbose -Message $Localization.Patient -Verbose
Start-Sleep -Seconds 2 Start-Sleep -Seconds 2
} }

6
src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1

@ -2,8 +2,8 @@
.SYNOPSIS .SYNOPSIS
Default preset file for "Sophia Script for Windows 10 LTSC 2021" Default preset file for "Sophia Script for Windows 10 LTSC 2021"
Version: v5.14.3 Version: v5.14.4
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic
@ -70,7 +70,7 @@ param
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2021 v5.14.3 | 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.14.4 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
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

6
src/Sophia_Script_for_Windows_10_PowerShell_7/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: v5.14.3 Version: v5.14.4
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic
@ -50,7 +50,7 @@ function Sophia
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.14.3 (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.14.4 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
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
src/Sophia_Script_for_Windows_10_PowerShell_7/Manifest/Sophia.psd1

@ -1,6 +1,6 @@
@{ @{
RootModule = '..\Module\Sophia.psm1' RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '5.14.3' ModuleVersion = '5.14.4'
GUID = 'aa0b47a7-1770-4b5d-8c9f-cc6c505bcc7a' GUID = 'aa0b47a7-1770-4b5d-8c9f-cc6c505bcc7a'
Author = 'Dmitry "farag" Nefedov' Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved' Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'

9
src/Sophia_Script_for_Windows_10_PowerShell_7/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: v5.14.3 Version: v5.14.4
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic
@ -6260,8 +6260,6 @@ function NetworkAdaptersSavePower
$Enable $Enable
) )
Write-Verbose -Message $Localization.Patient -Verbose
if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}) if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"})
{ {
$PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name) $PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name)
@ -6295,10 +6293,9 @@ function NetworkAdaptersSavePower
{ {
while while
( (
Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | ForEach-Object -Process {$_.Status -eq "Disconnected"} Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | Where-Object -FilterScript {$_.Status -eq "Disconnected"}
) )
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose Write-Verbose -Message $Localization.Patient -Verbose
Start-Sleep -Seconds 2 Start-Sleep -Seconds 2
} }

6
src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1

@ -2,8 +2,8 @@
.SYNOPSIS .SYNOPSIS
Default preset file for "Sophia Script for Windows 10 (PowerShell 7)" Default preset file for "Sophia Script for Windows 10 (PowerShell 7)"
Version: v5.14.3 Version: v5.14.4
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic
@ -70,7 +70,7 @@ param
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.14.3 (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.14.4 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
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

6
src/Sophia_Script_for_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.2.3 Version: v6.2.4
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic
@ -50,7 +50,7 @@ function Sophia
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.2.3 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022" $Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.2.4 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
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
src/Sophia_Script_for_Windows_11/Manifest/Sophia.psd1

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

21
src/Sophia_Script_for_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.2.3 Version: v6.2.4
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic
@ -5723,8 +5723,6 @@ function NetworkAdaptersSavePower
$Enable $Enable
) )
Write-Verbose -Message $Localization.Patient -Verbose
if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}) if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"})
{ {
$PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name) $PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name)
@ -5758,10 +5756,9 @@ function NetworkAdaptersSavePower
{ {
while while
( (
Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | ForEach-Object -Process {$_.Status -eq "Disconnected"} Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | Where-Object -FilterScript {$_.Status -eq "Disconnected"}
) )
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose Write-Verbose -Message $Localization.Patient -Verbose
Start-Sleep -Seconds 2 Start-Sleep -Seconds 2
} }
@ -12373,7 +12370,7 @@ function EditWithPhotosContext ###
$Show $Show
) )
if ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber -lt 22621) if ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber -eq 22000)
{ {
if (Get-AppxPackage -Name Microsoft.Windows.Photos) if (Get-AppxPackage -Name Microsoft.Windows.Photos)
{ {
@ -12430,7 +12427,7 @@ function CreateANewVideoContext ###
$Show $Show
) )
if ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber -lt 22621) if ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber -eq 22000)
{ {
if (Get-AppxPackage -Name Microsoft.Windows.Photos) if (Get-AppxPackage -Name Microsoft.Windows.Photos)
{ {
@ -13030,12 +13027,12 @@ function UpdateLGPEPolicies
{ {
# Parse every ADMX template searching if it contains full path and registry key simultaneously # Parse every ADMX template searching if it contains full path and registry key simultaneously
[xml]$config = Get-Content -Path $admx.FullName -Encoding UTF8 [xml]$config = Get-Content -Path $admx.FullName -Encoding UTF8
$config.SelectNodes("//@*") | ForEach-Object {$_.value = $_.value.ToLower()} $config.SelectNodes("//@*") | ForEach-Object -Process {$_.value = $_.value.ToLower()}
$SplitPath = $Path.Name.Replace("HKEY_LOCAL_MACHINE\", "") $SplitPath = $Path.Name.Replace("HKEY_LOCAL_MACHINE\", "")
if ($config.SelectSingleNode("//*[local-name()='policy' and @key='$($SplitPath.ToLower())' and (@valueName='$($Item.ToLower())' or @Name='$($Item.ToLower())' or .//*[local-name()='enum' and @valueName='$($Item.ToLower())'])]")) if ($config.SelectSingleNode("//*[local-name()='policy' and @key='$($SplitPath.ToLower())' and (@valueName='$($Item.ToLower())' or @Name='$($Item.ToLower())' or .//*[local-name()='enum' and @valueName='$($Item.ToLower())'])]"))
{ {
Write-Verbose -Message $Item.Replace("{}", "") -Verbose Write-Verbose -Message ([string](($SplitPath, "|", $Item.Replace("{}", "")))) -Verbose
$Type = switch ((Get-Item -Path $Path.PSPath).GetValueKind($Item)) $Type = switch ((Get-Item -Path $Path.PSPath).GetValueKind($Item))
{ {
@ -13085,12 +13082,12 @@ function UpdateLGPEPolicies
{ {
# Parse every ADMX template searching if it contains full path and registry key simultaneously # Parse every ADMX template searching if it contains full path and registry key simultaneously
[xml]$config = Get-Content -Path $admx.FullName -Encoding UTF8 [xml]$config = Get-Content -Path $admx.FullName -Encoding UTF8
$config.SelectNodes("//@*") | ForEach-Object {$_.value = $_.value.ToLower()} $config.SelectNodes("//@*") | ForEach-Object -Process {$_.value = $_.value.ToLower()}
$SplitPath = $Path.Name.Replace("HKEY_CURRENT_USER\", "") $SplitPath = $Path.Name.Replace("HKEY_CURRENT_USER\", "")
if ($config.SelectSingleNode("//*[local-name()='policy' and @key='$($SplitPath.ToLower())' and (@valueName='$($Item.ToLower())' or @Name='$($Item.ToLower())' or .//*[local-name()='enum' and @valueName='$($Item.ToLower())'])]")) if ($config.SelectSingleNode("//*[local-name()='policy' and @key='$($SplitPath.ToLower())' and (@valueName='$($Item.ToLower())' or @Name='$($Item.ToLower())' or .//*[local-name()='enum' and @valueName='$($Item.ToLower())'])]"))
{ {
Write-Verbose -Message $Item.Replace("{}", "") -Verbose Write-Verbose -Message ([string](($SplitPath, "|", $Item.Replace("{}", "")))) -Verbose
$Type = switch ((Get-Item -Path $Path.PSPath).GetValueKind($Item)) $Type = switch ((Get-Item -Path $Path.PSPath).GetValueKind($Item))
{ {

6
src/Sophia_Script_for_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.2.3 Version: v6.2.4
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic
@ -69,7 +69,7 @@ param
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.2.3 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022" $Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.2.4 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
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
src/Sophia_Script_for_Windows_11_PowerShell_7/Functions.ps1

@ -3,7 +3,7 @@
The TAB completion for functions and their arguments The TAB completion for functions and their arguments
Version: v6.2.3 Version: v6.2.3
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic

9
src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

@ -3,7 +3,7 @@
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.2.3 Version: v6.2.3
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic
@ -5731,8 +5731,6 @@ function NetworkAdaptersSavePower
$Enable $Enable
) )
Write-Verbose -Message $Localization.Patient -Verbose
if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}) if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"})
{ {
$PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name) $PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name)
@ -5766,10 +5764,9 @@ function NetworkAdaptersSavePower
{ {
while while
( (
Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | ForEach-Object -Process {$_.Status -eq "Disconnected"} Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | Where-Object -FilterScript {$_.Status -eq "Disconnected"}
) )
{ {
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose Write-Verbose -Message $Localization.Patient -Verbose
Start-Sleep -Seconds 2 Start-Sleep -Seconds 2
} }
@ -12401,7 +12398,7 @@ function EditWithPhotosContext
$Show $Show
) )
if ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber -lt 22621) if ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber -eq 22000)
{ {
if (Get-AppxPackage -Name Microsoft.Windows.Photos) if (Get-AppxPackage -Name Microsoft.Windows.Photos)
{ {

2
src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1

@ -3,7 +3,7 @@
Default preset file for "Sophia Script for Windows 11 (PowerShell 7)" Default preset file for "Sophia Script for Windows 11 (PowerShell 7)"
Version: v6.2.3 Version: v6.2.3
Date: 04.11.2022 Date: 21.11.2022
Copyright (c) 20142022 farag Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic Copyright (c) 20192022 farag & Inestic

Loading…
Cancel
Save