Add a function for creating shortcuts
This commit is contained in:
parent
1c45b5e746
commit
49e18cb6ca
2 changed files with 25 additions and 2 deletions
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue