New option to hide duplicate removable drive entries from windows explorer

This commit is contained in:
Raphire
2023-10-15 19:48:27 +02:00
parent 5bebe2866d
commit 3321781b31
5 changed files with 24 additions and 31 deletions

View File

@@ -16,6 +16,7 @@ param
[Parameter(ValueFromPipeline = $true)][switch]$DisableSuggestions,
[Parameter(ValueFromPipeline = $true)][switch]$ShowHiddenFolders,
[Parameter(ValueFromPipeline = $true)][switch]$ShowKnownFileExt,
[Parameter(ValueFromPipeline = $true)][switch]$HideDupliDrive,
[Parameter(ValueFromPipeline = $true)][switch]$TaskbarAlignLeft,
[Parameter(ValueFromPipeline = $true)][switch]$HideSearchTb,
[Parameter(ValueFromPipeline = $true)][switch]$ShowSearchIconTb,
@@ -76,6 +77,8 @@ function RemoveApps {
# Remove provisioned app from OS image, so the app won't be installed for any new users
Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like $app } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }
}
Write-Output ""
}
@@ -89,6 +92,7 @@ function RegImport {
Write-Output $Message
reg import $path
Write-Output ""
}
@@ -358,28 +362,34 @@ if ((-not $PSBoundParameters.Count) -or $RunDefaults -or $RunWin11Defaults -or (
if ($( Read-Host -Prompt " Show file extensions for known file types? (y/n)" ) -eq 'y') {
$PSBoundParameters.Add('ShowKnownFileExt', $ShowKnownFileExt)
}
Write-Output ""
if ($( Read-Host -Prompt " Hide duplicate removable drive entries from the windows explorer sidepane so they only show under 'This PC'? (y/n)" ) -eq 'y') {
$PSBoundParameters.Add('HideDupliDrive', $HideDupliDrive)
}
}
# Only show option for disabling these specific folders for windows 10 users
if (get-ciminstance -query "select caption from win32_operatingsystem where caption like '%Windows 10%'"){
Write-Output ""
if ($( Read-Host -Prompt "Do you want to hide any folders from the windows explorer sidepanel? (y/n)" ) -eq 'y') {
if ($( Read-Host -Prompt "Do you want to hide any folders from the windows explorer sidepane? (y/n)" ) -eq 'y') {
Write-Output ""
if ($( Read-Host -Prompt " Hide the onedrive folder in windows explorer? (y/n)" ) -eq 'y') {
if ($( Read-Host -Prompt " Hide the onedrive folder from the windows explorer sidepane? (y/n)" ) -eq 'y') {
$PSBoundParameters.Add('HideOnedrive', $HideOnedrive)
}
Write-Output ""
if ($( Read-Host -Prompt " Hide the 3D objects folder in windows explorer? (y/n)" ) -eq 'y') {
if ($( Read-Host -Prompt " Hide the 3D objects folder from the windows explorer sidepane? (y/n)" ) -eq 'y') {
$PSBoundParameters.Add('Hide3dObjects', $Hide3dObjects)
}
Write-Output ""
if ($( Read-Host -Prompt " Hide the music folder in windows explorer? (y/n)" ) -eq 'y') {
if ($( Read-Host -Prompt " Hide the music folder from the windows explorer sidepane? (y/n)" ) -eq 'y') {
$PSBoundParameters.Add('HideMusic', $HideMusic)
}
}
@@ -449,122 +459,102 @@ else {
switch ($PSBoundParameters.Keys) {
'RemoveApps' {
RemoveApps "$PSScriptRoot/Appslist.txt" "> Removing pre-installed windows apps..."
Write-Output ""
continue
}
'RemoveGamingApps' {
RemoveApps "$PSScriptRoot/GamingAppslist.txt" "> Removing gaming-related windows apps..."
Write-Output ""
continue
}
'DisableTelemetry' {
RegImport "> Disabling telemetry, diagnostic data, app-launch tracking and targeted ads..." $PSScriptRoot\Regfiles\Disable_Telemetry.reg
Write-Output ""
continue
}
{$_ -in "DisableBingSearches", "DisableBing"} {
RegImport "> Disabling bing search, bing AI & cortana in windows search..." $PSScriptRoot\Regfiles\Disable_Bing_Cortana_In_Search.reg
Write-Output ""
continue
}
'DisableLockscreenTips' {
RegImport "> Disabling tips & tricks on the lockscreen..." $PSScriptRoot\Regfiles\Disable_Lockscreen_Tips.reg
Write-Output ""
continue
}
{$_ -in "DisableSuggestions", "DisableWindowsSuggestions"} {
RegImport "> Disabling tips, tricks, suggestions and ads across Windows..." $PSScriptRoot\Regfiles\Disable_Windows_Suggestions.reg
Write-Output ""
continue
}
'TaskbarAlignLeft' {
RegImport "> Aligning taskbar buttons to the left..." $PSScriptRoot\Regfiles\Align_Taskbar_Left.reg
Write-Output ""
continue
}
'HideSearchTb' {
RegImport "> Hiding the search icon from the taskbar..." $PSScriptRoot\Regfiles\Hide_Search_Taskbar.reg
Write-Output ""
continue
}
'ShowSearchIconTb' {
RegImport "> Changing taskbar search to icon only..." $PSScriptRoot\Regfiles\Show_Search_Icon.reg
Write-Output ""
continue
}
'ShowSearchLabelTb' {
RegImport "> Changing taskbar search to icon with label..." $PSScriptRoot\Regfiles\Show_Search_Icon_And_Label.reg
Write-Output ""
continue
}
'ShowSearchBoxTb' {
RegImport "> Changing taskbar search to search box..." $PSScriptRoot\Regfiles\Show_Search_Box.reg
Write-Output ""
continue
}
'HideTaskview' {
RegImport "> Hiding the taskview button from the taskbar..." $PSScriptRoot\Regfiles\Hide_Taskview_Taskbar.reg
Write-Output ""
continue
}
'DisableCopilot' {
RegImport "> Disabling Windows copilot..." $PSScriptRoot\Regfiles\Disable_Copilot.reg
Write-Output ""
continue
}
{$_ -in "HideWidgets", "DisableWidgets"} {
RegImport "> Disabling the widget service and hiding the widget icon from the taskbar..." $PSScriptRoot\Regfiles\Disable_Widgets_Taskbar.reg
Write-Output ""
continue
}
{$_ -in "HideChat", "DisableChat"} {
RegImport "> Hiding the chat icon from the taskbar..." $PSScriptRoot\Regfiles\Disable_Chat_Taskbar.reg
Write-Output ""
continue
}
'ClearStart' {
ClearStartMenu "> Removing all pinned apps from the start menu..."
Write-Output ""
continue
}
'ShowHiddenFolders' {
RegImport "> Unhiding hidden files, folders and drives..." $PSScriptRoot\Regfiles\Show_Hidden_Folders.reg
Write-Output ""
continue
}
'ShowKnownFileExt' {
RegImport "> Enabling file extensions for known file types..." $PSScriptRoot\Regfiles\Show_Extensions_For_Known_File_Types.reg
Write-Output ""
continue
}
'HideDupliDrive' {
RegImport "> Hiding duplicate removable drive entries from the windows explorer navigation pane..." $PSScriptRoot\Regfiles\Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg
continue
}
{$_ -in "HideOnedrive", "DisableOnedrive"} {
RegImport "> Hiding the onedrive folder in windows explorer..." $PSScriptRoot\Regfiles\Hide_Onedrive_Folder.reg
Write-Output ""
RegImport "> Hiding the onedrive folder from the windows explorer navigation pane..." $PSScriptRoot\Regfiles\Hide_Onedrive_Folder.reg
continue
}
{$_ -in "Hide3dObjects", "Disable3dObjects"} {
RegImport "> Hiding the 3D objects folder in windows explorer..." $PSScriptRoot\Regfiles\Hide_3D_Objects_Folder.reg
Write-Output ""
RegImport "> Hiding the 3D objects folder from the windows explorer navigation pane..." $PSScriptRoot\Regfiles\Hide_3D_Objects_Folder.reg
continue
}
{$_ -in "HideMusic", "DisableMusic"} {
RegImport "> Hiding the music folder in windows explorer..." $PSScriptRoot\Regfiles\Hide_Music_folder.reg
Write-Output ""
RegImport "> Hiding the music folder from the windows explorer navigation pane..." $PSScriptRoot\Regfiles\Hide_Music_folder.reg
continue
}
{$_ -in "HideIncludeInLibrary", "DisableIncludeInLibrary"} {
RegImport "> Hiding 'Include in library' in the context menu..." $PSScriptRoot\Regfiles\Disable_Include_in_library_from_context_menu.reg
Write-Output ""
continue
}
{$_ -in "HideGiveAccessTo", "DisableGiveAccessTo"} {
RegImport "> Hiding 'Give access to' in the context menu..." $PSScriptRoot\Regfiles\Disable_Give_access_to_context_menu.reg
Write-Output ""
continue
}
{$_ -in "HideShare", "DisableShare"} {
RegImport "> Hiding 'Share' in the context menu..." $PSScriptRoot\Regfiles\Disable_Share_from_context_menu.reg
Write-Output ""
continue
}
}