Add an option for showing file extensions

This commit is contained in:
Manuel Thalmann 2024-08-05 23:22:22 +02:00
parent ec5e4c6340
commit 3225d00f31
2 changed files with 17 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" // {
default = true;
};

View file

@ -124,6 +124,17 @@ Start-SoftwareInstaller @PSBoundParameters `
$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;
Remove-Item -Recurse $dir;
};