2023-09-15 14:33:51 +00:00
|
|
|
# Function to create shortcuts
|
2023-09-15 14:38:54 +00:00
|
|
|
function Add-Shortcut
|
|
|
|
{
|
2023-09-15 14:33:51 +00:00
|
|
|
[CmdletBinding()]
|
|
|
|
param
|
|
|
|
(
|
2023-09-15 14:38:54 +00:00
|
|
|
[string]
|
|
|
|
$Target,
|
|
|
|
[string]
|
|
|
|
$Shortcut,
|
|
|
|
[string]
|
|
|
|
$Arguments,
|
|
|
|
[string]
|
|
|
|
$Icon,
|
|
|
|
[string]
|
|
|
|
$Description
|
2023-09-15 14:33:51 +00:00
|
|
|
)
|
2023-09-15 14:40:37 +00:00
|
|
|
|
2023-09-15 14:33:51 +00:00
|
|
|
$WScriptShell = (New-Object -ComObject WScript.Shell)
|
|
|
|
$Shortcut = $WScriptShell.CreateShortcut($Shortcut)
|
|
|
|
$Shortcut.TargetPath = $Target
|
|
|
|
$Shortcut.Arguments = $Arguments
|
|
|
|
$Shortcut.IconLocation = $Icon
|
|
|
|
$Shortcut.Description = $Description
|
|
|
|
$Shortcut.Save()
|
2022-12-31 10:15:10 +00:00
|
|
|
}
|