Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
farag2 committed Feb 1, 2025
1 parent 1628543 commit d40e37f
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/Sophia_Script_for_Windows_10/Module/Sophia.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -6720,7 +6720,8 @@ function NetworkAdaptersSavePower
Write-Verbose -Message ([WinAPI.GetStrings]::GetString(12612)) -Verbose

# Checking whether there's an adapter that has AllowComputerToTurnOffDevice property to manage
$Adapters = Get-NetAdapter -Physical | Where-Object -FilterScript {$_.MacAddress} | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
# We need also check for adapter status per some laptops have many equal adapters records in adapters list
$Adapters = Get-NetAdapter -Physical | Where-Object -FilterScript {$_.MacAddress -and ($_.Status -eq "Up")} | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
if (-not $Adapters)
{
Write-Information -MessageData "" -InformationAction Continue
Expand Down Expand Up @@ -15338,6 +15339,7 @@ public static void PostMessage()
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
Write-Verbose -Message "https://ko-fi.com/Q5Q51QUJC" -Verbose
Write-Verbose -Message "https://boosty.to/sophiascript" -Verbose
Write-Information -MessageData "" -InformationAction Continue
}
#endregion Post Actions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5312,7 +5312,8 @@ function NetworkAdaptersSavePower
Write-Verbose -Message ([WinAPI.GetStrings]::GetString(12612)) -Verbose

# Checking whether there's an adapter that has AllowComputerToTurnOffDevice property to manage
$Adapters = Get-NetAdapter -Physical | Where-Object -FilterScript {$_.MacAddress} | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
# We need also check for adapter status per some laptops have many equal adapters records in adapters list
$Adapters = Get-NetAdapter -Physical | Where-Object -FilterScript {$_.MacAddress -and ($_.Status -eq "Up")} | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
if (-not $Adapters)
{
Write-Information -MessageData "" -InformationAction Continue
Expand Down Expand Up @@ -11794,6 +11795,7 @@ public static void PostMessage()
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
Write-Verbose -Message "https://ko-fi.com/Q5Q51QUJC" -Verbose
Write-Verbose -Message "https://boosty.to/sophiascript" -Verbose
Write-Information -MessageData "" -InformationAction Continue
}
#endregion Post Actions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5710,7 +5710,8 @@ function NetworkAdaptersSavePower
Write-Verbose -Message ([WinAPI.GetStrings]::GetString(12612)) -Verbose

# Checking whether there's an adapter that has AllowComputerToTurnOffDevice property to manage
$Adapters = Get-NetAdapter -Physical | Where-Object -FilterScript {$_.MacAddress} | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
# We need also check for adapter status per some laptops have many equal adapters records in adapters list
$Adapters = Get-NetAdapter -Physical | Where-Object -FilterScript {$_.MacAddress -and ($_.Status -eq "Up")} | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
if (-not $Adapters)
{
Write-Information -MessageData "" -InformationAction Continue
Expand Down Expand Up @@ -13159,6 +13160,7 @@ public static void PostMessage()
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
Write-Verbose -Message "https://ko-fi.com/Q5Q51QUJC" -Verbose
Write-Verbose -Message "https://boosty.to/sophiascript" -Verbose
Write-Information -MessageData "" -InformationAction Continue
}
#endregion Post Actions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6740,7 +6740,8 @@ function NetworkAdaptersSavePower
Write-Verbose -Message ([WinAPI.GetStrings]::GetString(12612)) -Verbose

# Checking whether there's an adapter that has AllowComputerToTurnOffDevice property to manage
$Adapters = Get-NetAdapter -Physical | Where-Object -FilterScript {$_.MacAddress} | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
# We need also check for adapter status per some laptops have many equal adapters records in adapters list
$Adapters = Get-NetAdapter -Physical | Where-Object -FilterScript {$_.MacAddress -and ($_.Status -eq "Up")} | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
if (-not $Adapters)
{
Write-Information -MessageData "" -InformationAction Continue
Expand Down Expand Up @@ -15368,6 +15369,7 @@ public static void PostMessage()
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
Write-Verbose -Message "https://ko-fi.com/Q5Q51QUJC" -Verbose
Write-Verbose -Message "https://boosty.to/sophiascript" -Verbose
Write-Information -MessageData "" -InformationAction Continue
}
#endregion Post Actions

Expand Down
4 changes: 3 additions & 1 deletion src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -6438,7 +6438,8 @@ function NetworkAdaptersSavePower
Write-Verbose -Message ([WinAPI.GetStrings]::GetString(12612)) -Verbose

# Checking whether there's an adapter that has AllowComputerToTurnOffDevice property to manage
$Adapters = Get-NetAdapter -Physical | Where-Object -FilterScript {$_.MacAddress} | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
# We need also check for adapter status per some laptops have many equal adapters records in adapters list
$Adapters = Get-NetAdapter -Physical | Where-Object -FilterScript {$_.MacAddress -and ($_.Status -eq "Up")} | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
if (-not $Adapters)
{
Write-Information -MessageData "" -InformationAction Continue
Expand Down Expand Up @@ -14322,6 +14323,7 @@ public static void PostMessage()
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
Write-Verbose -Message "https://ko-fi.com/Q5Q51QUJC" -Verbose
Write-Verbose -Message "https://boosty.to/sophiascript" -Verbose
Write-Information -MessageData "" -InformationAction Continue
}
#endregion Post Actions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5966,7 +5966,8 @@ function NetworkAdaptersSavePower
Write-Verbose -Message ([WinAPI.GetStrings]::GetString(12612)) -Verbose

# Checking whether there's an adapter that has AllowComputerToTurnOffDevice property to manage
$Adapters = Get-NetAdapter -Physical | Where-Object -FilterScript {$_.MacAddress} | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
# We need also check for adapter status per some laptops have many equal adapters records in adapters list
$Adapters = Get-NetAdapter -Physical | Where-Object -FilterScript {$_.MacAddress -and ($_.Status -eq "Up")} | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
if (-not $Adapters)
{
Write-Information -MessageData "" -InformationAction Continue
Expand Down Expand Up @@ -13151,6 +13152,7 @@ public static void PostMessage()
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
Write-Verbose -Message "https://ko-fi.com/Q5Q51QUJC" -Verbose
Write-Verbose -Message "https://boosty.to/sophiascript" -Verbose
Write-Information -MessageData "" -InformationAction Continue
}
#endregion Post Actions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6458,7 +6458,8 @@ function NetworkAdaptersSavePower
Write-Verbose -Message ([WinAPI.GetStrings]::GetString(12612)) -Verbose

# Checking whether there's an adapter that has AllowComputerToTurnOffDevice property to manage
$Adapters = Get-NetAdapter -Physical | Where-Object -FilterScript {$_.MacAddress} | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
# We need also check for adapter status per some laptops have many equal adapters records in adapters list
$Adapters = Get-NetAdapter -Physical | Where-Object -FilterScript {$_.MacAddress -and ($_.Status -eq "Up")} | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
if (-not $Adapters)
{
Write-Information -MessageData "" -InformationAction Continue
Expand Down Expand Up @@ -14352,6 +14353,7 @@ public static void PostMessage()
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
Write-Verbose -Message "https://ko-fi.com/Q5Q51QUJC" -Verbose
Write-Verbose -Message "https://boosty.to/sophiascript" -Verbose
Write-Information -MessageData "" -InformationAction Continue
}
#endregion Post Actions

Expand Down

0 comments on commit d40e37f

Please sign in to comment.