Browse Source

Minor changes

pull/514/head
Dmitry Nefedov 2 years ago
parent
commit
902ffce9c0
  1. 13
      src/Sophia_Script_for_Windows_10/Module/Sophia.psm1
  2. 1
      src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1
  3. 3
      src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1
  4. 11
      src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1
  5. 3
      src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
  6. 3
      src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

13
src/Sophia_Script_for_Windows_10/Module/Sophia.psm1

@ -1027,10 +1027,9 @@ function script:AdditionalChecks
{ {
$Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)" $Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)"
$ReadFile = Get-Content -Path $PresetName -Encoding UTF8
# Calculate the string number to uncomment "Checks -Warning" # Calculate the string number to uncomment "Checks -Warning"
$LineNumber = (Select-String -Path $PresetName -Pattern Checks | Select-String -Pattern "{Checks}", "The mandatory checks" -NotMatch).LineNumber $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} $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 (Get-Content -Path $PresetName -Encoding UTF8).Replace($RequiredLine, "Checks -Warning") | Set-Content -Path $PresetName -Encoding UTF8 -Force
@ -12317,7 +12316,7 @@ function GPUScheduling
if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual") if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual")
{ {
# Checking whether a WDDM verion is 2.7 or higher # 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) if ($WddmVersion_Min -ge 2700)
{ {
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force
@ -15424,13 +15423,13 @@ public static void PostMessage()
} }
# Call MeetNow unless binary value is reverted # 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 #endregion Other actions

1
src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1

@ -877,7 +877,6 @@ function script:AdditionalChecks
{ {
$Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)" $Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)"
$ReadFile = Get-Content -Path $PresetName -Encoding UTF8
# Calculate the string number to uncomment "Checks -Warning" # Calculate the string number to uncomment "Checks -Warning"
$LineNumber = (Select-String -Path $PresetName -Pattern Checks | Select-String -Pattern "{Checks}", "The mandatory checks" -NotMatch).LineNumber $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 date from the required line to replace it with "Checks -Warning"

3
src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1

@ -880,7 +880,6 @@ function script:AdditionalChecks
{ {
$Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)" $Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)"
$ReadFile = Get-Content -Path $PresetName -Encoding UTF8
# Calculate the string number to uncomment "Checks -Warning" # Calculate the string number to uncomment "Checks -Warning"
$LineNumber = (Select-String -Path $PresetName -Pattern Checks | Select-String -Pattern "{Checks}", "The mandatory checks" -NotMatch).LineNumber $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 date from the required line to replace it with "Checks -Warning"
@ -10031,7 +10030,7 @@ function GPUScheduling
if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual") if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual")
{ {
# Checking whether a WDDM verion is 2.7 or higher # 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) if ($WddmVersion_Min -ge 2700)
{ {
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force

11
src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1

@ -1031,7 +1031,6 @@ function script:AdditionalChecks
{ {
$Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)" $Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)"
$ReadFile = Get-Content -Path $PresetName -Encoding UTF8
# Calculate the string number to uncomment "Checks -Warning" # Calculate the string number to uncomment "Checks -Warning"
$LineNumber = (Select-String -Path $PresetName -Pattern Checks | Select-String -Pattern "{Checks}", "The mandatory checks" -NotMatch).LineNumber $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 date from the required line to replace it with "Checks -Warning"
@ -12342,7 +12341,7 @@ function GPUScheduling
if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual") if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual")
{ {
# Checking whether a WDDM verion is 2.7 or higher # 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) if ($WddmVersion_Min -ge 2700)
{ {
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force
@ -15451,13 +15450,13 @@ public static void PostMessage()
} }
# Call MeetNow unless binary value is reverted # 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 #endregion Other actions

3
src/Sophia_Script_for_Windows_11/Module/Sophia.psm1

@ -1078,7 +1078,6 @@ function script:AdditionalChecks
{ {
$Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)" $Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)"
$ReadFile = Get-Content -Path $PresetName -Encoding UTF8
# Calculate the string number to uncomment "Checks -Warning" # Calculate the string number to uncomment "Checks -Warning"
$LineNumber = (Select-String -Path $PresetName -Pattern Checks | Select-String -Pattern "{Checks}", "The mandatory checks" -NotMatch).LineNumber $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 date from the required line to replace it with "Checks -Warning"
@ -11971,7 +11970,7 @@ function GPUScheduling
if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual") if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual")
{ {
# Checking whether a WDDM verion is 2.7 or higher # 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) if ($WddmVersion_Min -ge 2700)
{ {
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force

3
src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

@ -1082,7 +1082,6 @@ function script:AdditionalChecks
{ {
$Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)" $Host.UI.RawUI.WindowTitle = "Checks | $($PresetName)"
$ReadFile = Get-Content -Path $PresetName -Encoding UTF8
# Calculate the string number to uncomment "Checks -Warning" # Calculate the string number to uncomment "Checks -Warning"
$LineNumber = (Select-String -Path $PresetName -Pattern Checks | Select-String -Pattern "{Checks}", "The mandatory checks" -NotMatch).LineNumber $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 date from the required line to replace it with "Checks -Warning"
@ -11996,7 +11995,7 @@ function GPUScheduling
if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual") if ((Get-CimInstance -ClassName CIM_ComputerSystem).Model -notmatch "Virtual")
{ {
# Checking whether a WDDM verion is 2.7 or higher # 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) if ($WddmVersion_Min -ge 2700)
{ {
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" -Name HwSchMode -PropertyType DWord -Value 2 -Force

Loading…
Cancel
Save