Skip to content

Commit 61c417a

Browse files
committed
Fixed bug when CleanupTask function couldn't create a value in the BranchCache
1 parent b9fa5ad commit 61c417a

File tree

6 files changed

+24
-0
lines changed
  • Sophia Script

6 files changed

+24
-0
lines changed

Sophia Script/Sophia Script for Windows 10 LTSC 2019/Module/Sophia.psm1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7375,6 +7375,10 @@ function CleanupTask
73757375
)
73767376
foreach ($VolumeCache in $VolumeCaches)
73777377
{
7378+
if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache"))
7379+
{
7380+
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Force
7381+
}
73787382
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Name StateFlags1337 -PropertyType DWord -Value 2 -Force
73797383
}
73807384

Sophia Script/Sophia Script for Windows 10 LTSC 2021/Module/Sophia.psm1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8475,6 +8475,10 @@ function CleanupTask
84758475
)
84768476
foreach ($VolumeCache in $VolumeCaches)
84778477
{
8478+
if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache"))
8479+
{
8480+
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Force
8481+
}
84788482
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Name StateFlags1337 -PropertyType DWord -Value 2 -Force
84798483
}
84808484

Sophia Script/Sophia Script for Windows 10 PowerShell 7/Module/Sophia.psm1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10729,6 +10729,10 @@ function CleanupTask
1072910729
)
1073010730
foreach ($VolumeCache in $VolumeCaches)
1073110731
{
10732+
if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache"))
10733+
{
10734+
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Force
10735+
}
1073210736
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Name StateFlags1337 -PropertyType DWord -Value 2 -Force
1073310737
}
1073410738

Sophia Script/Sophia Script for Windows 10/Module/Sophia.psm1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10688,6 +10688,10 @@ function CleanupTask
1068810688
)
1068910689
foreach ($VolumeCache in $VolumeCaches)
1069010690
{
10691+
if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache"))
10692+
{
10693+
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Force
10694+
}
1069110695
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Name StateFlags1337 -PropertyType DWord -Value 2 -Force
1069210696
}
1069310697

Sophia Script/Sophia Script for Windows 11 PowerShell 7/Module/Sophia.psm1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10192,6 +10192,10 @@ function CleanupTask
1019210192
)
1019310193
foreach ($VolumeCache in $VolumeCaches)
1019410194
{
10195+
if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache"))
10196+
{
10197+
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Force
10198+
}
1019510199
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Name StateFlags1337 -PropertyType DWord -Value 2 -Force
1019610200
}
1019710201

Sophia Script/Sophia Script for Windows 11/Module/Sophia.psm1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10152,6 +10152,10 @@ function CleanupTask
1015210152
)
1015310153
foreach ($VolumeCache in $VolumeCaches)
1015410154
{
10155+
if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache"))
10156+
{
10157+
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Force
10158+
}
1015510159
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Name StateFlags1337 -PropertyType DWord -Value 2 -Force
1015610160
}
1015710161

0 commit comments

Comments
 (0)