Windows-terminal-context-menu
Windows-terminal-context-menu copied to clipboard
Git Bash default icon on context menu is replaced by unknown.ico
When I ran the SetupContextMenu.ps1 script, the git bash icon on the installer folder isn't defined, instead, the unknown.ico is defined.
# Corrige le chemin des icones
$NomShells = (Get-ChildItem -Path 'HKCU:\Software\Classes\Directory\ContextMenus\WindowsTerminal\shell' -Name) #$NomShells[0] $NumNomShells = $NomShells.Count #echo $NumNomShells
for ($MonCompteur = 0; $MonCompteur -le $NumNomShells; $MonCompteur ++){
# PowerShell
if ($NomShells[$MonCompteur] -like '*PowerShell*' -eq $True) {
$a=($NomShells[$MonCompteur] | Out-String) -replace '\r?\n\z'
# echo $a
Set-ItemProperty -Path "HKCU:\Software\Classes\Directory\ContextMenus\WindowsTerminal\shell\$a" -Name "Icon" -type "String" -Value "$env:LOCALAPPDATA\WindowsTerminalContextIcons\powershell.ico"
}
# Cmd
if ($NomShells[$MonCompteur] -like '*Cmd*' -eq $True -or $NomShells[$MonCompteur] -like '*Invite-de-commandes*' -eq $True -or $NomShells[$MonCompteur] -like '*Command-Prompt*' -eq $True) {
$a=($NomShells[$MonCompteur] | Out-String) -replace '\r?\n\z'
# echo $a
Set-ItemProperty -Path "HKCU:\Software\Classes\Directory\ContextMenus\WindowsTerminal\shell\$a" -Name "Icon" -type "String" -Value "$env:LOCALAPPDATA\WindowsTerminalContextIcons\cmd.ico"
}
}