Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
silv4b opened this issue Aug 26, 2021 · 1 comment
Open

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

silv4b opened this issue Aug 26, 2021 · 1 comment

Comments

@silv4b
Copy link

silv4b commented Aug 26, 2021

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

@GhislainSamy
Copy link

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

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants