I included some detection logic in a deployment script to check for the existence of the installed product before making an attempt to install/uninstall the application. I placed the conditional logic into a function and placed the function in the "AppDeployToolkitExtensions.ps1". The detection logic works flawlessly when the function is called from my "Deploy-Application.ps1." My question is quite simple I would like to create a custom command line parameter that calls the custom Toolkit function if the parameter is used in the command line. For example; it is assumed that the following forces the uninstall to execute Silently (non-interactively) otherwise the default nature is to execute the install routine interactively.
Best Regards,
Yves
Deploy-Application.ps1 -DeploymentType "Uninstall" -DeployMode "Silent"
I would like to accomplish something similar Deploy-Application.ps1 -DeploymentType "Uninstall" -DeployMode "Silent" -CustomParam "Yes"
Where the default behavior of "-CustomParam" is set to "No" unless explicitly set to "Yes" at which point would call the custom function in the "AppDeployToolkitExtensions.ps1" to process conditional logic. Any suggestions on how to accomplish this would be greatly appreciated. Best Regards,
Yves