Windows-terminal-context-menu icon indicating copy to clipboard operation
Windows-terminal-context-menu copied to clipboard

Git Bash default icon on context menu is replaced by unknown.ico

Open silv4b opened this issue 4 years ago • 1 comments

When I ran the SetupContextMenu.ps1 script, the git bash icon on the installer folder isn't defined, instead, the unknown.ico is defined.

silv4b avatar Aug 26 '21 19:08 silv4b

# 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"
}

}

GhislainSamy avatar Aug 09 '22 18:08 GhislainSamy