Create PS Script in PowerShell App Deployment Toolkit (PSADTK) that will set multiple shortcuts
$10-30 USD
Lezárt
Kiadva ekkor: majdnem 6 évvel ezelőtt
$10-30 USD
Teljesítéskor fizetve
Using PASDTK I have a script that sets various shortcuts with a single command line switch for each shortcut. I what to be able to set all the shortcuts with a new single switch.
Here is the code I have so far. I can run the script with the individual switches but want to be able to run for all switches as a single install.
Param (
[switch]$1st_Prod = $false,
[switch]$2nd_Prod = $false
)
If ($deploymentType -ine 'Uninstall') {
##*===============================================
##* PRE-INSTALLATION
##*===============================================
[string]$installPhase = 'Pre-Installation'
## Show Progress Message (with the default message)
##Show-InstallationProgress
## <Perform Pre-Installation tasks here>
#Create OSD Task Sequence Environment Object
If ($1st_Prod) {
[string]$MICS_LOC = '\\[login to view URL]'
[string]$MICS_Arg = 'CF=Arg1'
[string]$MICS_Sort_Name = '1st [login to view URL]'
}
ElseIf ($2nd_Prod) {
[string]$MICS_LOC = '\\[login to view URL]'
[string]$MICS_Arg = 'CF=Arg2'
[string]$MICS_Sort_Name = '2nd [login to view URL]'
}
##*===============================================
##* INSTALLATION
##*===============================================
[string]$installPhase = 'Installation'
##Show-InstallationProgress -StatusMessage 'Installing SAPPI MICS Client. Please wait…'
Write-Log -Message "Installation of MICS Client bit has started. addComponentsOnly: $addComponentsOnly isServerOS: $isServerOS" -Source $deployAppScriptFriendlyName
New-Shortcut -Path "$envAppData\Microsoft\Windows\Start Menu\Programs\MICS\$MICS_Sort_Name" -TargetPath "$MICS_LOC\sharedsw\MICSCONF_NSS\LaunchProd\[login to view URL]" -Arguments $MICS_Arg -IconLocation "$MICS_LOC\sharedsw\MICSCONF_NSS\LaunchProd\[login to view URL]" -Description "[login to view URL]" -WorkingDirectory "$MICS_LOC\sharedsw\MICSCONF_NSS\LaunchProd"