fix: shutdown computer shortcut is now created due to a dumb mistake 🤦‍♂️

- Added hotkey to shortcut description
main
PlĂ­nio Larrubia 2 years ago committed by PlĂ­nio Larrubia
parent d3dfa24640
commit 4bd3771a4c
No known key found for this signature in database
GPG Key ID: 057B0A87CB137C69

@ -119,7 +119,7 @@ Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force; ls -Recurse *.ps*1 |
- `Enable/Disable God Mode`: [Enables](./src/utils/enable-god-mode.ps1) or [Disables](./src/utils/disable-god-mode.ps1) the hidden Desktop folder **God Mode**;
- `Enable/Disable Take Ownership menu`: [Enables](./src/utils/enable-take-ownership-context-menu.reg) or [Disables](src/utils/disable-take-ownership-context-menu.reg) the **Take Ownership context menu**;
- `Enable/Disable Shutdown PC shortcut`: [Enables](./src/utils/enable-shutdown-pc-shortcut.ps1) or [Disables](./src/utils/disable-shutdown-pc-shortcut.ps1) the **Shutdown Computer desktop shortcut** (May not work on the GUI);
- `Enable/Disable Shutdown PC shortcut`: [Enables](./src/utils/enable-shutdown-pc-shortcut.ps1) or [Disables](./src/utils/disable-shutdown-pc-shortcut.ps1) the **Shutdown Computer desktop shortcut**;
### Software Install

@ -777,11 +777,11 @@ function Show-GUI() {
$CbShutdownPCShortcut.Add_Click( {
If ($CbShutdownPCShortcut.CheckState -eq "Checked") {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("enable-shutdown-pc-shortcut.ps1") -NoDialog
Open-PowerShellFilesCollection -RelativeLocation "src\utils" -Scripts @("enable-shutdown-pc-shortcut.ps1") -NoDialog
$CbShutdownPCShortcut.Text = "[ON] Shutdown PC shortcut"
}
Else {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("disable-shutdown-pc-shortcut.ps1") -NoDialog
Open-PowerShellFilesCollection -RelativeLocation "src\utils" -Scripts @("disable-shutdown-pc-shortcut.ps1") -NoDialog
$CbShutdownPCShortcut.Text = "[OFF] Shutdown PC... (Default)"
}
})

@ -26,11 +26,19 @@ function New-Shortcut() {
$WScriptObj = New-Object -ComObject ("WScript.Shell")
$Shortcut = $WScriptObj.CreateShortcut($ShortcutPath)
$Shortcut.TargetPath = $SourcePath
$Shortcut.Description = $Description
If ($Hotkey) {
$Shortcut.Description += " ($Hotkey)"
}
Else {
$Shortcut.Description = $Description
}
$Shortcut.Arguments = $Arguments
$ShortCut.Hotkey = $Hotkey
$Shortcut.IconLocation = $IconLocation
$Shortcut.WindowStyle = $WindowStyle
$Shortcut.Save()
}

@ -23,7 +23,7 @@ function Open-PowerShellFilesCollection {
Import-Module -DisableNameChecking .\"$FileName" -Force
}
Else {
PowerShell -NoProfile -ExecutionPolicy Bypass -file .\"$FileName"
PowerShell -NoProfile -ExecutionPolicy Bypass -File .\"$FileName"
}
}

Loading…
Cancel
Save