Skip to content

Commit 3857183

Browse files
committed
Fixed Microsoft Defender false positive
Also renamed `HideRecommendedSection` to `StartRecommendedSection`
1 parent de30502 commit 3857183

File tree

24 files changed

+133
-133
lines changed

24 files changed

+133
-133
lines changed

Download_Latest_Sophia.ps1

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,31 +156,31 @@ if (Test-Path -Path "$DownloadsFolder\$($Version)_Latest")
156156
exit
157157
}
158158

159-
New-Item -Path "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin" -ItemType Directory -Force
159+
New-Item -Path "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries" -ItemType Directory -Force
160160

161161
& "$env:SystemRoot\System32\tar.exe" -C "$DownloadsFolder\SophiaScriptTemp" -xf "$DownloadsFolder\master.zip" "Sophia-Script-for-Windows-master/src/$Version"
162162

163163
# Download LGPO
164164
# https://techcommunity.microsoft.com/t5/microsoft-security-baselines/lgpo-exe-local-group-policy-object-utility-v1-0/ba-p/701045
165165
$Parameters = @{
166166
Uri = "https://download.microsoft.com/download/8/5/C/85C25433-A1B0-4FFA-9429-7E023E7DA8D8/LGPO.zip"
167-
OutFile = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin\LGPO.zip"
167+
OutFile = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries\LGPO.zip"
168168
UseBasicParsing = $true
169169
Verbose = $true
170170
}
171171
Invoke-WebRequest @Parameters
172172

173173
$Parameters = @{
174-
Path = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin\LGPO.zip"
175-
DestinationPath = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin"
174+
Path = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries\LGPO.zip"
175+
DestinationPath = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries"
176176
Force = $true
177177
Verbose = $true
178178
}
179179
Expand-Archive @Parameters
180180

181181
$Parameters = @{
182-
Path = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin\LGPO_30\LGPO.exe"
183-
Destination = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin\LGPO.exe"
182+
Path = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries\LGPO_30\LGPO.exe"
183+
Destination = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries\LGPO.exe"
184184
Force = $true
185185
}
186186
Move-Item @Parameters
@@ -191,19 +191,19 @@ if ($Version -match "PowerShell_7")
191191
# https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref
192192
$Parameters = @{
193193
Uri = "https://www.nuget.org/api/v2/package/Microsoft.Windows.SDK.NET.Ref"
194-
OutFile = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin\microsoft.windows.sdk.net.ref.zip"
194+
OutFile = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries\microsoft.windows.sdk.net.ref.zip"
195195
UseBasicParsing = $true
196196
}
197197
Invoke-RestMethod @Parameters
198198

199199
# Extract Microsoft.Windows.SDK.NET.dll & WinRT.Runtime.dll from archive
200200
Add-Type -Assembly System.IO.Compression.FileSystem
201-
$ZIP = [IO.Compression.ZipFile]::OpenRead("$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin\microsoft.windows.sdk.net.ref.zip")
201+
$ZIP = [IO.Compression.ZipFile]::OpenRead("$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries\microsoft.windows.sdk.net.ref.zip")
202202
$Entries = $ZIP.Entries | Where-Object -FilterScript {($_.FullName -eq "lib/net8.0/Microsoft.Windows.SDK.NET.dll") -or ($_.FullName -eq "lib/net8.0/WinRT.Runtime.dll")}
203-
$Entries | ForEach-Object -Process {[IO.Compression.ZipFileExtensions]::ExtractToFile($_, "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin\$($_.Name)", $true)}
203+
$Entries | ForEach-Object -Process {[IO.Compression.ZipFileExtensions]::ExtractToFile($_, "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries\$($_.Name)", $true)}
204204
$ZIP.Dispose()
205205

206-
Remove-Item -Path "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin\microsoft.windows.sdk.net.ref.zip" -Force
206+
Remove-Item -Path "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries\microsoft.windows.sdk.net.ref.zip" -Force
207207
}
208208

209209
$Parameters = @{
@@ -222,8 +222,8 @@ Move-Item @Parameters
222222

223223
$Path = @(
224224
"$DownloadsFolder\SophiaScriptTemp",
225-
"$DownloadsFolder\$($Version)_Latest\bin\LGPO_30",
226-
"$DownloadsFolder\$($Version)_Latest\bin\LGPO.zip",
225+
"$DownloadsFolder\$($Version)_Latest\Binaries\LGPO_30",
226+
"$DownloadsFolder\$($Version)_Latest\Binaries\LGPO.zip",
227227
"$DownloadsFolder\master.zip"
228228
)
229229
Remove-Item -Path $Path -Recurse -Force

Scripts/Windows_10.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_PowerS
66

77
Write-Verbose -Message "Sophia.Script.for.Windows.10.v$LatestRelease.zip" -Verbose
88

9-
New-Item -Path "Sophia_Script_for_Windows_10_v$LatestRelease\bin" -ItemType Directory -Force
9+
New-Item -Path "Sophia_Script_for_Windows_10_v$LatestRelease\Binaries" -ItemType Directory -Force
1010

1111
$Parameters = @{
1212
Path = @("Scripts\LGPO.exe")
13-
Destination = "Sophia_Script_for_Windows_10_v$LatestRelease\bin"
13+
Destination = "Sophia_Script_for_Windows_10_v$LatestRelease\Binaries"
1414
Recurse = $true
1515
Force = $true
1616
}

Scripts/Windows_10_LTSC_2019.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_LTSC20
66

77
Write-Verbose -Message "Sophia.Script.for.Windows.10.LTSC.2019.v$LatestRelease.zip" -Verbose
88

9-
New-Item -Path "Sophia_Script_for_Windows_10_LTSC_2019_v$LatestRelease\bin" -ItemType Directory -Force
9+
New-Item -Path "Sophia_Script_for_Windows_10_LTSC_2019_v$LatestRelease\Binaries" -ItemType Directory -Force
1010

1111
$Parameters = @{
1212
Path = @("Scripts\LGPO.exe")
13-
Destination = "Sophia_Script_for_Windows_10_LTSC_2019_v$LatestRelease\bin"
13+
Destination = "Sophia_Script_for_Windows_10_LTSC_2019_v$LatestRelease\Binaries"
1414
Recurse = $true
1515
Force = $true
1616
}

Scripts/Windows_10_LTSC_2021.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_LTSC20
66

77
Write-Verbose -Message "Sophia.Script.for.Windows.10.LTSC.2021.v$LatestRelease.zip" -Verbose
88

9-
New-Item -Path "Sophia_Script_for_Windows_10_LTSC_2021_v$LatestRelease\bin" -ItemType Directory -Force
9+
New-Item -Path "Sophia_Script_for_Windows_10_LTSC_2021_v$LatestRelease\Binaries" -ItemType Directory -Force
1010

1111
$Parameters = @{
1212
Path = @("Scripts\LGPO.exe")
13-
Destination = "Sophia_Script_for_Windows_10_LTSC_2021_v$LatestRelease\bin"
13+
Destination = "Sophia_Script_for_Windows_10_LTSC_2021_v$LatestRelease\Binaries"
1414
Recurse = $true
1515
Force = $true
1616
}

Scripts/Windows_10_PS_7.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_PowerS
66

77
Write-Verbose -Message "Sophia.Script.for.Windows.10.PowerShell.7.v$LatestRelease.zip" -Verbose
88

9-
New-Item -Path "Sophia_Script_for_Windows_10_PowerShell_7_v$LatestRelease\bin" -ItemType Directory -Force
9+
New-Item -Path "Sophia_Script_for_Windows_10_PowerShell_7_v$LatestRelease\Binaries" -ItemType Directory -Force
1010

1111
$Parameters = @{
1212
Path = @("Scripts\LGPO.exe", "Scripts\WinRT.Runtime.dll", "Scripts\Microsoft.Windows.SDK.NET.dll")
13-
Destination = "Sophia_Script_for_Windows_10_PowerShell_7_v$LatestRelease\bin"
13+
Destination = "Sophia_Script_for_Windows_10_PowerShell_7_v$LatestRelease\Binaries"
1414
Recurse = $true
1515
Force = $true
1616
}

Scripts/Windows_11.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerS
66

77
Write-Verbose -Message "Sophia.Script.for.Windows.11.v$LatestRelease.zip" -Verbose
88

9-
New-Item -Path "Sophia_Script_for_Windows_11_v$LatestRelease\bin" -ItemType Directory -Force
9+
New-Item -Path "Sophia_Script_for_Windows_11_v$LatestRelease\Binaries" -ItemType Directory -Force
1010

1111
$Parameters = @{
1212
Path = @("Scripts\LGPO.exe")
13-
Destination = "Sophia_Script_for_Windows_11_v$LatestRelease\bin"
13+
Destination = "Sophia_Script_for_Windows_11_v$LatestRelease\Binaries"
1414
Recurse = $true
1515
Force = $true
1616
}

Scripts/Windows_11_LTSC_2024.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_LTSC20
66

77
Write-Verbose -Message "Sophia.Script.for.Windows.11.LTSC.2024.v$LatestRelease.zip" -Verbose
88

9-
New-Item -Path "Sophia_Script_for_Windows_11_LTSC_2024_v$LatestRelease\bin" -ItemType Directory -Force
9+
New-Item -Path "Sophia_Script_for_Windows_11_LTSC_2024_v$LatestRelease\Binaries" -ItemType Directory -Force
1010

1111
$Parameters = @{
1212
Path = @("Scripts\LGPO.exe")
13-
Destination = "Sophia_Script_for_Windows_11_LTSC_2024_v$LatestRelease\bin"
13+
Destination = "Sophia_Script_for_Windows_11_LTSC_2024_v$LatestRelease\Binaries"
1414
Recurse = $true
1515
Force = $true
1616
}

Scripts/Windows_11_PS_7.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerS
66

77
Write-Verbose -Message "Sophia.Script.for.Windows.11.PowerShell.7.v$LatestRelease.zip" -Verbose
88

9-
New-Item -Path "Sophia_Script_for_Windows_11_PowerShell_7_v$LatestRelease\bin" -ItemType Directory -Force
9+
New-Item -Path "Sophia_Script_for_Windows_11_PowerShell_7_v$LatestRelease\Binaries" -ItemType Directory -Force
1010

1111
$Parameters = @{
1212
Path = @("Scripts\LGPO.exe", "Scripts\WinRT.Runtime.dll", "Scripts\Microsoft.Windows.SDK.NET.dll")
13-
Destination = "Sophia_Script_for_Windows_11_PowerShell_7_v$LatestRelease\bin"
13+
Destination = "Sophia_Script_for_Windows_11_PowerShell_7_v$LatestRelease\Binaries"
1414
Recurse = $true
1515
Force = $true
1616
}

Wrapper/Config/config_Windows_11.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -876,13 +876,13 @@
876876
"Region": "UI & Personalization",
877877
"Control": "cmb",
878878
"Required": "false",
879-
"Function": "HideRecommendedSection",
879+
"Function": "StartRecommendedSection",
880880
"Arg": {
881881
"Zero": {
882-
"Tag": "Disable"
882+
"Tag": "Hide"
883883
},
884884
"One": {
885-
"Tag": "Enable"
885+
"Tag": "Show"
886886
}
887887
},
888888
"Preset": "Zero",

Wrapper/Config/config_Windows_11_LTSC.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -896,13 +896,13 @@
896896
"Region": "UI & Personalization",
897897
"Control": "cmb",
898898
"Required": "false",
899-
"Function": "HideRecommendedSection",
899+
"Function": "StartRecommendedSection",
900900
"Arg": {
901901
"Zero": {
902-
"Tag": "Disable"
902+
"Tag": "Hide"
903903
},
904904
"One": {
905-
"Tag": "Enable"
905+
"Tag": "Show"
906906
}
907907
},
908908
"Preset": "Zero",

0 commit comments

Comments
 (0)