Add a function for creating shortcuts

This commit is contained in:
Manuel Thalmann 2024-08-24 04:18:33 +02:00
parent 6d6ca0ff04
commit f2074466ae
2 changed files with 25 additions and 2 deletions

View file

@ -30,6 +30,27 @@ function Remove-DesktopIcon {
}
}
<#
.SYNOPSIS
Adds a new shortcut to the start menu.
.PARAMETER Name
The name of the icon to create.
.PARAMETER Target
The file to link to.
#>
function Add-StartMenuIcon {
param(
[string] $Name,
[string] $Target
)
Import-Module KnownFolders;
Import-Module "$env:ChocolateyInstall/helpers/chocolateyInstaller.psm1";
Install-ChocolateyShortcut -ShortcutFilePath "$((Get-KnownFolder "Common Programs").Path)/$Name.lnk" -TargetPath ((Get-Item $Target).FullName);
}
<#
.SYNOPSIS
Removes icons from the task bar.

View file

@ -4,12 +4,14 @@ param(
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
. "$PSScriptRoot/../../../Common/Scripts/System.ps1";
Start-SoftwareInstaller @PSBoundParameters `
-Installer {
Install-ChocoPackage retroarch;
# ToDo: Add start menu shortcut
# ToDo: Add function for this purpose
} `
-Configurator {
Add-StartMenuIcon "RetroArch" "C:\tools\RetroArch-Win64\retroarch.exe";
};
# ToDo: Add restoration