Quantcast
Channel: psappdeploytoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1769

New Post: rename Deploy of the ps1 or exe

$
0
0
Okay, let me revise my initial proposal as follows. Here's your new Param section changes:
[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.

Viewing all articles
Browse latest Browse all 1769


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>