|
@ -4476,16 +4476,7 @@ function StartRecommendedSection |
|
|
$Show |
|
|
$Show |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
# Windows 11 IoT Enterprise not supported |
|
|
# Windows 11 IoT Enterprise is supported too. No need to check Windows edition |
|
|
$WINDOWS_LONG = [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%") |
|
|
|
|
|
if (($WINDOWS_LONG -notmatch "Enterprise") -and ($WINDOWS_LONG -notmatch "Education") -or ($WINDOWS_LONG -eq "Windows 11 IoT Enterprise")) |
|
|
|
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
Write-Verbose -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -Verbose |
|
|
|
|
|
Write-Error -Message ($Localization.Skipped -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue |
|
|
|
|
|
|
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Remove all policies in order to make changes visible in UI only if it's possible |
|
|
# Remove all policies in order to make changes visible in UI only if it's possible |
|
|
Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Force -ErrorAction Ignore |
|
|
Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Force -ErrorAction Ignore |
|
@ -4499,13 +4490,20 @@ function StartRecommendedSection |
|
|
{ |
|
|
{ |
|
|
New-Item -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Force |
|
|
New-Item -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Force |
|
|
} |
|
|
} |
|
|
|
|
|
if (-not (Test-Path -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education)) |
|
|
|
|
|
{ |
|
|
|
|
|
New-Item -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education -Force |
|
|
|
|
|
} |
|
|
New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -PropertyType DWord -Value 1 -Force |
|
|
New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -PropertyType DWord -Value 1 -Force |
|
|
|
|
|
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education -Name IsEducationEnvironment -PropertyType DWord -Value 1 -Force |
|
|
|
|
|
|
|
|
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type DWORD -Value 1 |
|
|
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type DWORD -Value 1 |
|
|
} |
|
|
} |
|
|
"Show" |
|
|
"Show" |
|
|
{ |
|
|
{ |
|
|
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Force -ErrorAction Ignore |
|
|
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Force -ErrorAction Ignore |
|
|
|
|
|
Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education -Name IsEducationEnvironment -Force -ErrorAction Ignore |
|
|
|
|
|
Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Start -Name HideRecommendedSection -Force -ErrorAction Ignore |
|
|
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type CLEAR |
|
|
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type CLEAR |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|