Add an option for showing file extensions

This commit is contained in:
Manuel Thalmann 2024-08-05 23:22:22 +02:00
parent 901262b8a7
commit 6268eab1e5
2 changed files with 16 additions and 0 deletions

View file

@ -19,6 +19,12 @@
}; };
}; };
showFileExt = mkOption {
type = types.bool;
description = "A value indicating whether file extensions should be displayed in Windows Explorer.";
default = true;
};
legacyIconSpacing = mkEnableOption "legacy icon spacing" // { legacyIconSpacing = mkEnableOption "legacy icon spacing" // {
default = true; default = true;
}; };

View file

@ -124,6 +124,16 @@ Start-SoftwareInstaller @PSBoundParameters `
$startLayout | ConvertTo-Json -Compress | Set-Content "$env:SystemDrive\Users\Default\AppData\Local\Microsoft\Windows\Shell\LayoutModification.json"; $startLayout | ConvertTo-Json -Compress | Set-Content "$env:SystemDrive\Users\Default\AppData\Local\Microsoft\Windows\Shell\LayoutModification.json";
} }
if (Get-WinConfig "showFileExt") {
Edit-DefaultUserKey {
param (
[RegistryKey] $Key
)
Set-ItemProperty "$($Key.PSPath)\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Value 0 -Type "DWord";
};
}
Pop-Location; Pop-Location;
Remove-Item -Recurse $dir; Remove-Item -Recurse $dir;
}; };