Okay, let me revise my initial proposal as follows. Here's your new Param section changes:
Deploy-Application.exe -Profile "Marketing"
This would be a cleaner way, rather than creating a new parameter for each department. And there should be no limit to the number of different profile names you can use.
Hope this helps, Dan.
[switch] $TerminalServerMode = $false,
[string] $Profile = $null
And here's the body of your script:# Validate Profile parameter
If ($Profile -eq $null -or $Profile -eq "") { Show-DialogBox -Text "You must specify a valid profile using the -Profile parameter" -Icon "Stop"; Exit-Script -ExitCode 2 }
# Install common apps here
Execute-MSI -Action Install -Path "MyCommonApp.msi"
# Install Profile-specific applications
# Switch ($Profile) {
"Accounting" {
# Install Accounting apps
Execute-MSI -Action Install -Path "MyAccountingApp.msi"
}
"Finance" {
# Install Finance apps
Execute-MSI -Action Install -Path "MyFinanceApp.msi"
}
"Marketing" {
# Install Marketing apps
Execute-MSI -Action Install -Path "MyMarketingApp.msi"
}
To execute, you'd run Deploy-Application.exe -Profile "Marketing"
This would be a cleaner way, rather than creating a new parameter for each department. And there should be no limit to the number of different profile names you can use.
Hope this helps, Dan.