I hope I can find some help here.
I have a script set that with a switch I can install a shortcut for a specific instance. I have 10 instances which I will set each in SCCM for each need. I am looking for a way I can have an instance that wil set all 10 with a single switch
This is an example of what I have for the individual items
<pre class=“brush: powershell; gutter: true; first-line: 1; highlight: []; html-script: false”>
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 = '\\micsap-CO.com'
[string]$MICS_Arg = 'CF=Arg1'
[string]$MICS_Sort_Name = '1st Prod.lnk'
}
ElseIf ($2nd_Prod) {
[string]$MICS_LOC = '\\micsap-NSC.com'
[string]$MICS_Arg = 'CF=Arg2'
[string]$MICS_Sort_Name = '2nd Prod.lnk'
}
##*===============================================
##* 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\ML_Launch.exe" -Arguments $MICS_Arg -IconLocation "$MICS_LOC\sharedsw\MICSCONF_NSS\LaunchProd\ML_Launch.exe" -Description "ML_Launch.exe" -WorkingDirectory "$MICS_LOC\sharedsw\MICSCONF_NSS\LaunchProd"
This is a snippet to give an idea. I suspect I may need some type of looping but not sure what is needed.
Your help would be greatly appreciated and beers are certainly to be provided.
Thank-you
Scott