Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
farag2 committed Jun 28, 2023
1 parent 854bc6c commit 902ffce
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 20 deletions.
13 changes: 6 additions & 7 deletions src/Sophia_Script_for_Windows_10/Module/Sophia.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1027,10 +1027,9 @@ function script:AdditionalChecks
{
$Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)"

$ReadFile = Get-Content -Path $PresetName -Encoding UTF8
# Calculate the string number to uncomment "Checks -Warning"
$LineNumber = (Select-String -Path $PresetName -Pattern Checks | Select-String -Pattern "{Checks}", "The mandatory checks" -NotMatch).LineNumber
# Get date from the required line to replace it with "Checks -Warning"
# Get data from the required line to replace it with "Checks -Warning"
$RequiredLine = (Get-Content -Path $PresetName -Encoding UTF8) | Where-Object -FilterScript {$_.ReadCount -eq $LineNumber}
(Get-Content -Path $PresetName -Encoding UTF8).Replace($RequiredLine, "Checks -Warning") | Set-Content -Path $PresetName -Encoding UTF8 -Force

Expand Down Expand Up @@ -12317,7 +12316,7 @@ function GPUScheduling
if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual")
{
# Checking whether a WDDM verion is 2.7 or higher
$WddmVersion_Min = Get-ItemPropertyValue -Path HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\FeatureSetUsage -Name WddmVersion_Min
$WddmVersion_Min = [Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\FeatureSetUsage", "WddmVersion_Min", $null)
if ($WddmVersion_Min -ge 2700)
{
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force
Expand Down Expand Up @@ -15424,13 +15423,13 @@ public static void PostMessage()
}

# Call MeetNow unless binary value is reverted
if ($Script:MeetNow)
if (-not $Script:MeetNow)
{
MeetNow -Show
MeetNow -Hide
}
elseif ($Script:MeetNow -eq $false)
elseif ($Script:MeetNow)
{
MeetNow -Hide
MeetNow -Show
}
#endregion Other actions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,6 @@ function script:AdditionalChecks
{
$Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)"

$ReadFile = Get-Content -Path $PresetName -Encoding UTF8
# Calculate the string number to uncomment "Checks -Warning"
$LineNumber = (Select-String -Path $PresetName -Pattern Checks | Select-String -Pattern "{Checks}", "The mandatory checks" -NotMatch).LineNumber
# Get date from the required line to replace it with "Checks -Warning"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,6 @@ function script:AdditionalChecks
{
$Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)"

$ReadFile = Get-Content -Path $PresetName -Encoding UTF8
# Calculate the string number to uncomment "Checks -Warning"
$LineNumber = (Select-String -Path $PresetName -Pattern Checks | Select-String -Pattern "{Checks}", "The mandatory checks" -NotMatch).LineNumber
# Get date from the required line to replace it with "Checks -Warning"
Expand Down Expand Up @@ -10031,7 +10030,7 @@ function GPUScheduling
if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual")
{
# Checking whether a WDDM verion is 2.7 or higher
$WddmVersion_Min = Get-ItemPropertyValue -Path HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\FeatureSetUsage -Name WddmVersion_Min
$WddmVersion_Min = [Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\FeatureSetUsage", "WddmVersion_Min", $null)
if ($WddmVersion_Min -ge 2700)
{
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force
Expand Down
11 changes: 5 additions & 6 deletions src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,6 @@ function script:AdditionalChecks
{
$Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)"

$ReadFile = Get-Content -Path $PresetName -Encoding UTF8
# Calculate the string number to uncomment "Checks -Warning"
$LineNumber = (Select-String -Path $PresetName -Pattern Checks | Select-String -Pattern "{Checks}", "The mandatory checks" -NotMatch).LineNumber
# Get date from the required line to replace it with "Checks -Warning"
Expand Down Expand Up @@ -12342,7 +12341,7 @@ function GPUScheduling
if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual")
{
# Checking whether a WDDM verion is 2.7 or higher
$WddmVersion_Min = Get-ItemPropertyValue -Path HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\FeatureSetUsage -Name WddmVersion_Min
$WddmVersion_Min = [Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\FeatureSetUsage", "WddmVersion_Min", $null)
if ($WddmVersion_Min -ge 2700)
{
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force
Expand Down Expand Up @@ -15451,13 +15450,13 @@ public static void PostMessage()
}

# Call MeetNow unless binary value is reverted
if ($Script:MeetNow)
if (-not $Script:MeetNow)
{
MeetNow -Show
MeetNow -Hide
}
elseif ($Script:MeetNow -eq $false)
elseif ($Script:MeetNow)
{
MeetNow -Hide
MeetNow -Show
}
#endregion Other actions

Expand Down
3 changes: 1 addition & 2 deletions src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,6 @@ function script:AdditionalChecks
{
$Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)"

$ReadFile = Get-Content -Path $PresetName -Encoding UTF8
# Calculate the string number to uncomment "Checks -Warning"
$LineNumber = (Select-String -Path $PresetName -Pattern Checks | Select-String -Pattern "{Checks}", "The mandatory checks" -NotMatch).LineNumber
# Get date from the required line to replace it with "Checks -Warning"
Expand Down Expand Up @@ -11971,7 +11970,7 @@ function GPUScheduling
if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual")
{
# Checking whether a WDDM verion is 2.7 or higher
$WddmVersion_Min = Get-ItemPropertyValue -Path HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\FeatureSetUsage -Name WddmVersion_Min
$WddmVersion_Min = [Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\FeatureSetUsage", "WddmVersion_Min", $null)
if ($WddmVersion_Min -ge 2700)
{
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,6 @@ function script:AdditionalChecks
{
$Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)"

$ReadFile = Get-Content -Path $PresetName -Encoding UTF8
# Calculate the string number to uncomment "Checks -Warning"
$LineNumber = (Select-String -Path $PresetName -Pattern Checks | Select-String -Pattern "{Checks}", "The mandatory checks" -NotMatch).LineNumber
# Get date from the required line to replace it with "Checks -Warning"
Expand Down Expand Up @@ -11996,7 +11995,7 @@ function GPUScheduling
if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual")
{
# Checking whether a WDDM verion is 2.7 or higher
$WddmVersion_Min = Get-ItemPropertyValue -Path HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\FeatureSetUsage -Name WddmVersion_Min
$WddmVersion_Min = [Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\FeatureSetUsage", "WddmVersion_Min", $null)
if ($WddmVersion_Min -ge 2700)
{
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force
Expand Down

0 comments on commit 902ffce

Please sign in to comment.