A parameter cannot be found that matches parameter name 'eq'.

Topics: Archive - Deployment Scripts
Feb 12, 2015 at 3:59 PM
I am finally getting around to testing version 3.5.0, in my first attempted to convert a 3.1.4 based script to 3.5.0 using the following condition which returns an error.
if (Get-InstalledApplication -Name "Wireshark 1.12.3 (64-bit)" -eq $appName -and $appDisplayVersion -eq $appVersion) {
    
        Show-InstallationPrompt -Message "An installation of $appName $appVersion exists." -ButtonRightText "Ok" -Icon Information -NoWait; Write-Log "ErrorCode Return value is: 1638, proceeding."; Exit-Script -ExitCode 1638
    } else {
    
        # Show Welcome Message, close Internet Explorer if required, allow up to 3 deferrals, verify there is enough disk space to complete the install and persist the prompt
        Show-InstallationWelcome -CloseApps "wireshark,op_flse,aceanalyst" -AllowDefer -DeferTimes 5 -CheckDiskSpace -PersistPrompt
    
        # Show Progress Message (with the default message)
        Show-InstallationProgress
        }
Message : A parameter cannot be found that matches parameter name 'eq'.
InnerException :

FullyQualifiedErrorId : NamedParameterNotFound,Get-InstalledApplication


I saw a similar post with the exact same verbiage, but the solution (below) was not applicable. What am I not accounting for?
In the if() remove -eq true. It's treating -eq as a parameter, not a comparison operator.
Coordinator
Feb 12, 2015 at 5:13 PM
I think that should be:

if (((Get-InstalledApplication -Name "Wireshark 1.12.3 (64-bit)") -eq $appName) -and ($appDisplayVersion -eq $appVersion))

Cheers, Dan
Marked as answer by yralexandre on 2/17/2015 at 12:06 PM
Feb 12, 2015 at 9:31 PM
sintaxasn wrote:
I think that should be:

if (((Get-InstalledApplication -Name "Wireshark 1.12.3 (64-bit)") -eq $appName) -and ($appDisplayVersion -eq $appVersion))

Cheers, Dan
Problem Solved! Thank you!

Best Regards,

Yves
Feb 16, 2015 at 4:54 PM
Edited Feb 18, 2015 at 2:45 PM
Hello Dan, I think that I may have spoken too soon.

while the addition of the parentheses in the following
if (((Get-InstalledApplication -Name "Wireshark 1.12.3 (64-bit)") -eq $appName) -and ($appDisplayVersion -eq $appVersion))
relsoved the original problem I reported
Message : A parameter cannot be found that matches parameter name 'eq'.
InnerException :

FullyQualifiedErrorId : NamedParameterNotFound,Get-InstalledApplication
I noticed some odd behavior when running the script against PSADT 3.5.0.
  1. My detection logic is completely ignored in PSADT 3.5.0; however in the 3.1.4 PSADT of the script halts the installation and presents a message box with the parameters specified in "Show-InstallationPrompt"
  2. In the "[string]$installPhase = 'Post-Installation'" section of version 3.5.0 I specify the following parameters
Show-InstallationPrompt -Message 'The installation of $appName $appVersion complete.' -ButtonRightText 'OK' -Icon Information -NoWait
The message box appears, but the variables are never processed. the following text appears in the message box:
The installation of $appName $appVersion complete.
The message text should read
The installation of Wireshark 1.12.3 complete.
The log seems to indicat that the logic was processed.
[02-16-2015 12:01:05.683] [Pre-Installation] [Get-InstalledApplication] :: Get information for installed Application Name(s) [Wireshark 1.12.3 (64-bit)]...
[02-16-2015 12:01:06.923] [Pre-Installation] [Get-InstalledApplication] :: Found installed application [Wireshark 1.12.3 (64-bit)] version [1.12.3] matching application name [Wireshark 1.12.3 (64-bit)]
The log also seems to indicate that the message box is displayed.
[02-16-2015 12:01:52.768] [Post-Installation] [Show-InstallationPrompt] :: Displaying custom installation prompt with the non-default parameters: [-NoWait:$true -ButtonRightText "OK" -Icon "Information" -Message "The installation of $appName $appVersion complete."]...
[02-16-2015 12:01:52.968] [Post-Installation] [Exit-Script] :: Wireshark_1.12.3_EN_01 Installation completed with exit code [0].
P.S. Screenshots would probably be helpful, is the there a way to include them?
Coordinator
Feb 18, 2015 at 5:03 PM
Message : A parameter cannot be found that matches parameter name 'eq'.
InnerException :

I think you have a closing bracket missing - it's assuming you have -eq as a parameter of Get-InstalledApplication. I would suspect your issue is here:

if (((Get-InstalledApplication -Name "Wireshark 1.12.3 (64-bit)">>)<< -eq $appName) -and ($appDisplayVersion -eq $appVersion))

Re variables not being expanded, this is because you are using single quotes, which don't expand variables unlike double quotes.. You would need to use
Show-InstallationPrompt -Message 'The installation of '$appName' '$appVersion' complete.' -ButtonRightText 'OK' -Icon Information -NoWait
Or
Show-InstallationPrompt -Message "The installation of $appName $appVersion complete." -ButtonRightText 'OK' -Icon Information -NoWait
Feb 18, 2015 at 7:01 PM
Edited Feb 18, 2015 at 7:19 PM
Alright. I reverted the script back to its original form. which included the following:
Show-InstallationPrompt -Message "The installation of $appName $appVersion complete." -ButtonRightText 'OK' -Icon Information -NoWait
and continues to display the following
The installation of $appName $appVersion complete.
but, not before trying your recommendation which failed to display the "installation prompt" all together.
Show-InstallationPrompt -Message 'The installation of '$appName' '$appVersion' complete.' -ButtonRightText 'OK' -Icon Information -NoWait
In addition to the oddities noted above the script completely ignores what I assumed to be simple and sound branching logic. In that if the product is installed the installation routine should be halted and conversely the uninstall routine should be halted if the product does not exist. What is happening is the opposite. The script installs the product when executed then reinstalls the product when executed subsequently. The PSADT 3.1.4 equivalent does not exhibit this behavior.

While I understand that
' vs "
can adversely affect the execution of the script; in a side be side comparison of the script below and a script that I slightly modified (the one containing the single quotes) and the differences were negligible. I am thoroughly confused as to why PSADT 3.1.4 equivalent of the problematic PSADT 3.5.0 script below executes flawlessly. Please help me understand where my oversight lies.
<#
.SYNOPSIS
    This script performs the installation or uninstallation of an application(s).
.DESCRIPTION
    The script is provided as a template to perform an install or uninstall of an application(s). 
    The script either performs an "Install" deployment type or an "Uninstall" deployment type.
    The install deployment type is broken down into 3 main sections/phases: Pre-Install, Install, and Post-Install.
    The script dot-sources the AppDeployToolkitMain.ps1 script which contains the logic and functions required to install or uninstall an application.
.PARAMETER DeploymentType
    The type of deployment to perform. Default is: Install.
.PARAMETER DeployMode
    Specifies whether the installation should be run in Interactive, Silent, or NonInteractive mode. Default is: Interactive. Options: Interactive = Shows dialogs, Silent = No dialogs, NonInteractive = Very silent, i.e. no blocking apps. NonInteractive mode is automatically set if it is detected that the process is not user interactive.
.PARAMETER AllowRebootPassThru
    Allows the 3010 return code (requires restart) to be passed back to the parent process (e.g. SCCM) if detected from an installation. If 3010 is passed back to SCCM, a reboot prompt will be triggered.
.PARAMETER TerminalServerMode
    Changes to "user install mode" and back to "user execute mode" for installing/uninstalling applications for Remote Destkop Session Hosts/Citrix servers.
.EXAMPLE
    Deploy-Application.ps1
.EXAMPLE
    Deploy-Application.ps1 -DeployMode 'Silent'
.EXAMPLE
    Deploy-Application.ps1 -AllowRebootPassThru -AllowDefer
.EXAMPLE
    Deploy-Application.ps1 -DeploymentType Uninstall
.NOTES
.LINK 
    http://psappdeploytoolkit.codeplex.com
#>
[CmdletBinding()]
Param (
    [Parameter(Mandatory=$false)]
    [ValidateSet('Install','Uninstall')] 
    [string]$DeploymentType = 'Install',
    [Parameter(Mandatory=$false)]
    [ValidateSet('Interactive','Silent','NonInteractive')]
    [string]$DeployMode = 'Interactive',
    [Parameter(Mandatory=$false)]
    [switch]$AllowRebootPassThru = $false,
    [Parameter(Mandatory=$false)]
    [switch]$TerminalServerMode = $false
)

Try {
    ## Set the script execution policy for this process
    Try { Set-ExecutionPolicy -ExecutionPolicy 'ByPass' -Scope 'Process' -Force -ErrorAction 'Stop' } Catch {}
    
    ##*===============================================
    ##* VARIABLE DECLARATION
    ##*===============================================
    ## Variables: Application
    [string]$appVendor = ''
    [string]$appName = 'Wireshark'
    [string]$appVersion = '1.12.3'
    [string]$appArch = ''
    [string]$appLang = 'EN'
    [string]$appRevision = '01'
    [string]$appScriptVersion = '1.0.1502.11'
    [string]$appScriptDate = '2015.02.11'
    [string]$appScriptAuthor = 'alexayr'
    ##*===============================================
    
    ##* Do not modify section below
    #region DoNotModify
    
    ## Variables: Exit Code
    [int32]$mainExitCode = 0
    
    ## Variables: Script
    [string]$deployAppScriptFriendlyName = 'Deploy Application'
    [version]$deployAppScriptVersion = [version]'3.5.0'
    [string]$deployAppScriptDate = '11/17/2014'
    [hashtable]$deployAppScriptParameters = $psBoundParameters
    
    ## Variables: Environment
    [string]$scriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
    
    ## Dot source the required App Deploy Toolkit Functions
    Try {
        [string]$moduleAppDeployToolkitMain = "$scriptDirectory\AppDeployToolkit\AppDeployToolkitMain.ps1"
        If (-not (Test-Path -Path $moduleAppDeployToolkitMain -PathType Leaf)) { Throw "Module does not exist at the specified location [$moduleAppDeployToolkitMain]." }
        . $moduleAppDeployToolkitMain
    }
    Catch {
        [int32]$mainExitCode = 1
        Write-Output "Module [$moduleAppDeployToolkitMain] failed to load: `n$($_.Exception.Message) `n$($_.InvocationInfo.PositionMessage)"
        Exit $mainExitCode
    }
    
    ## Handle ServiceUI Invocation
    If ($serviceUIExitCode) { Exit-Script -ExitCode $serviceUIExitCode }
    
    #endregion
    ##* Do not modify section above
    ##*===============================================
    ##* END VARIABLE DECLARATION
    ##*===============================================
        
    If ($DeploymentType -ine 'Uninstall') {
        ##*===============================================
        ##* PRE-INSTALLATION
        ##*===============================================
        [string]$installPhase = 'Pre-Installation'
        
        #CheckExist modified to include Application version
        if (((Get-InstalledApplication -Name "Wireshark 1.12.3 (64-bit)") -eq $appName) -and ($appDisplayVersion -eq $appVersion)) {
        
            Show-InstallationPrompt -Message "An installation of $appName $appVersion exists." -ButtonRightText "Ok" -Icon Information -NoWait; Write-Log "ErrorCode Return value is: 1638, proceeding."; Exit-Script -ExitCode 1638
        } else {
        
            # Show Welcome Message, close Internet Explorer if required, allow up to 3 deferrals, verify there is enough disk space to complete the install and persist the prompt
            Show-InstallationWelcome -CloseApps "wireshark,op_flse,aceanalyst" -AllowDefer -DeferTimes 5 -CheckDiskSpace -PersistPrompt
        
            # Show Progress Message (with the default message)
            Show-InstallationProgress
            }
        
        ##*===============================================
        ##* INSTALLATION 
        ##*===============================================
        [string]$installPhase = 'Installation'
        
        ## <Perform Installation tasks here>
        if ($is64Bit -eq $true) {
        Execute-Process -FilePath "Wireshark-win64-1.12.3.exe" -Arguments "/S /desktopicon=no /quicklaunchicon=no" -WindowStyle Hidden -IgnoreExitCodes "1,2,3"
        } Else {
        Execute-Process -FilePath "Wireshark-win32-1.12.3.exe" -Arguments "/S /desktopicon=no /quicklaunchicon=no" -WindowStyle Hidden -IgnoreExitCodes "1,2,3"
        }
        
        
        ##*===============================================
        ##* POST-INSTALLATION
        ##*===============================================
        [string]$installPhase = 'Post-Installation'

        ## <Perform Post-Installation tasks here>

        ## Display a message at the end of the install
        Show-InstallationPrompt -Message 'The installation of $appName $appVersion complete.' -ButtonRightText 'OK' -Icon Information -NoWait
    }
    ElseIf ($DeploymentType -ieq 'Uninstall')
    {
        ##*===============================================
        ##* PRE-UNINSTALLATION
        ##*===============================================
        [string]$installPhase = 'Pre-Uninstallation'
        
        #CheckExist modified to include Application version
        if (((Get-InstalledApplication -Name "Wireshark 1.12.3 (64-bit)") -eq $appName) -and ($appDisplayVersion -eq $appVersion))  {
    
        # Show Welcome Message, close Internet Explorer if required with a 60 second countdown before automatically closing
        Show-InstallationWelcome -CloseApps "wireshark,op_flse,aceanalyst" -CloseAppsCountdown "60"
    
        # Show Progress Message (with the default message)
        Show-InstallationProgress
                    
        ##*===============================================
        ##* UNINSTALLATION
        ##*===============================================
        [string]$installPhase = 'Uninstallation'
        
        # <Perform Uninstallation tasks here>
        if ($is64Bit -eq $true) {
            Execute-Process -FilePath "$envProgramFiles\Wireshark\uninstall.exe" -Arguments "/S" -WindowStyle Hidden -IgnoreExitCodes "1,2,3"
            } Else {
            Execute-Process -FilePath "$envProgramFilesX86\Wireshark\uninstall.exe" -Arguments "/S" -WindowStyle Hidden -IgnoreExitCodes "1,2,3"
            }
        
            # Display a message at the end of the uninstall
            Show-InstallationPrompt -Message "The uninstallation of $appName $appVersion complete." -ButtonRightText "Ok" -Icon Information -NoWait     
        } else {
        
            Show-InstallationPrompt -Message "$appName $appVersion is not installed." -ButtonRightText "Ok" -Icon Information -NoWait; Write-Log "ErrorCode Return value is: 1605, proceeding."; Exit-Script -ExitCode 1605
            }
        
        
        ##*===============================================
        ##* POST-UNINSTALLATION
        ##*===============================================
        [string]$installPhase = 'Post-Uninstallation'
        
        ## <Perform Post-Uninstallation tasks here>
    }
    
    ##*===============================================
    ##* END SCRIPT BODY
    ##*===============================================
    
    ## Call the Exit-Script function to perform final cleanup operations
    Exit-Script -ExitCode $mainExitCode
}
Catch {
    [int32]$mainExitCode = 1
    [string]$mainErrorMessage = "$(Resolve-Error)"
    Write-Log -Message $mainErrorMessage -Severity 3 -Source $deployAppScriptFriendlyName
    Show-DialogBox -Text $mainErrorMessage -Icon 'Stop'
    Exit-Script -ExitCode $mainExitCode
}
Feb 24, 2015 at 3:36 PM
Were you able to get this working I want to do this also... Thanks!
Coordinator
Feb 24, 2015 at 10:29 PM
Hi Yves,

Sorry, I've been swamped with work. I've only managed to look at this now.

Okay, so I can' t understand how your script ever worked correctly, the returned object means it shouldn't have - you weren't referencing properties when getting either the DisplayName or DisplayVersion. You are seeing a switch in logic because (Get-InstalledApplication -Name "Wireshark 1.12.3 (64-bit)") returns an object with properties, not a text string, so when you use an -eq it returns $false because it doesn't match the text string.

Here's how it should be done:
        $appInstalled = Get-InstalledApplication -Name "Wireshark 1.12.3 (64-bit)"
        If (($appInstalled.DisplayName -eq $appName) -and ($appInstalled.DisplayVersion -eq $appVersion)) { 
            # DO STUFF
        }
This was never changed since we implemented Get-InstalledApplication I dont think. Is it possible you used to use this?
If (Get-InstalledApplication -Name "Wireshark 1.12.3 (64-bit)") { 
      # DO STUFF
}
This would return $true if it's installed because the object exists. If no app is installed, no object exists and $null is returned, which, in your logic would equate to $false.


Secondly, when using text strings in Show-InstallationPrompt, you need to use double quotes. This works for me:
Show-InstallationPrompt -Message "The installation of $appName $appVersion complete." -ButtonRightText 'OK' -Icon Information -NoWait
I'm going to replace the default in the template so people don't have this issue going forward.

Cheers, Dan
Marked as answer by yralexandre on 2/24/2015 at 10:24 PM
Feb 25, 2015 at 6:36 AM
Dan,

The following script has your recommended changes and now works as intended. Thanks again for your extremely helpful expert guidance.
<#
.SYNOPSIS
    This script performs the installation or uninstallation of an application(s).
.DESCRIPTION
    The script is provided as a template to perform an install or uninstall of an application(s). 
    The script either performs an "Install" deployment type or an "Uninstall" deployment type.
    The install deployment type is broken down into 3 main sections/phases: Pre-Install, Install, and Post-Install.
    The script dot-sources the AppDeployToolkitMain.ps1 script which contains the logic and functions required to install or uninstall an application.
.PARAMETER DeploymentType
    The type of deployment to perform. Default is: Install.
.PARAMETER DeployMode
    Specifies whether the installation should be run in Interactive, Silent, or NonInteractive mode. Default is: Interactive. Options: Interactive = Shows dialogs, Silent = No dialogs, NonInteractive = Very silent, i.e. no blocking apps. NonInteractive mode is automatically set if it is detected that the process is not user interactive.
.PARAMETER AllowRebootPassThru
    Allows the 3010 return code (requires restart) to be passed back to the parent process (e.g. SCCM) if detected from an installation. If 3010 is passed back to SCCM, a reboot prompt will be triggered.
.PARAMETER TerminalServerMode
    Changes to "user install mode" and back to "user execute mode" for installing/uninstalling applications for Remote Destkop Session Hosts/Citrix servers.
.EXAMPLE
    Deploy-Application.ps1
.EXAMPLE
    Deploy-Application.ps1 -DeployMode 'Silent'
.EXAMPLE
    Deploy-Application.ps1 -AllowRebootPassThru -AllowDefer
.EXAMPLE
    Deploy-Application.ps1 -DeploymentType Uninstall
.NOTES
.LINK 
    http://psappdeploytoolkit.codeplex.com
#>
[CmdletBinding()]
Param (
    [Parameter(Mandatory=$false)]
    [ValidateSet('Install','Uninstall')] 
    [string]$DeploymentType = 'Install',
    [Parameter(Mandatory=$false)]
    [ValidateSet('Interactive','Silent','NonInteractive')]
    [string]$DeployMode = 'Interactive',
    [Parameter(Mandatory=$false)]
    [switch]$AllowRebootPassThru = $false,
    [Parameter(Mandatory=$false)]
    [switch]$TerminalServerMode = $false
)

Try {
    ## Set the script execution policy for this process
    Try { Set-ExecutionPolicy -ExecutionPolicy 'ByPass' -Scope 'Process' -Force -ErrorAction 'Stop' } Catch {}
    
    ##*===============================================
    ##* VARIABLE DECLARATION
    ##*===============================================
    ## Variables: Application
    [string]$appVendor = ''
    [string]$appName = 'Wireshark'
    [string]$appVersion = '1.12.3'
    [string]$appArch = ''
    [string]$appLang = 'EN'
    [string]$appRevision = '01'
    [string]$appScriptVersion = '1.0.1502.11'
    [string]$appScriptDate = '2015.02.11'
    [string]$appScriptAuthor = 'alexayr'
    ##*===============================================
    
    ##* Do not modify section below
    #region DoNotModify
    
    ## Variables: Exit Code
    [int32]$mainExitCode = 0
    
    ## Variables: Script
    [string]$deployAppScriptFriendlyName = 'Deploy Application'
    [version]$deployAppScriptVersion = [version]'3.5.0'
    [string]$deployAppScriptDate = '11/17/2014'
    [hashtable]$deployAppScriptParameters = $psBoundParameters
    
    ## Variables: Environment
    [string]$scriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
    
    ## Dot source the required App Deploy Toolkit Functions
    Try {
        [string]$moduleAppDeployToolkitMain = "$scriptDirectory\AppDeployToolkit\AppDeployToolkitMain.ps1"
        If (-not (Test-Path -Path $moduleAppDeployToolkitMain -PathType Leaf)) { Throw "Module does not exist at the specified location [$moduleAppDeployToolkitMain]." }
        . $moduleAppDeployToolkitMain
    }
    Catch {
        [int32]$mainExitCode = 1
        Write-Output "Module [$moduleAppDeployToolkitMain] failed to load: `n$($_.Exception.Message) `n$($_.InvocationInfo.PositionMessage)"
        Exit $mainExitCode
    }
    
    ## Handle ServiceUI Invocation
    If ($serviceUIExitCode) { Exit-Script -ExitCode $serviceUIExitCode }
    
    #endregion
    ##* Do not modify section above
    ##*===============================================
    ##* END VARIABLE DECLARATION
    ##*===============================================
        
    If ($DeploymentType -ine 'Uninstall') {
        ##*===============================================
        ##* PRE-INSTALLATION
        ##*===============================================
        [string]$installPhase = 'Pre-Installation'
        
        If (Get-InstalledApplication -Name "Wireshark 1.12.3 (64-bit)") {

            Show-InstallationPrompt -Message "An installation of $appName $appVersion exists." -ButtonRightText 'OK' -Icon Information -NoWait; Write-Log "ErrorCode Return value is: 1638, proceeding."; Exit-Script -ExitCode 1638
        } else {
        
            # Show Welcome Message, close Internet Explorer if required, allow up to 3 deferrals, verify there is enough disk space to complete the install and persist the prompt
            Show-InstallationWelcome -CloseApps "wireshark,op_flse,aceanalyst" -AllowDefer -DeferTimes 5 -CheckDiskSpace -PersistPrompt
        
            # Show Progress Message (with the default message)
            Show-InstallationProgress
            }
        
        ##*===============================================
        ##* INSTALLATION 
        ##*===============================================
        [string]$installPhase = 'Installation'
        
            ## <Perform Installation tasks here>
            if ($is64Bit -eq $true) {
                Execute-Process -FilePath "Wireshark-win64-1.12.3.exe" -Arguments "/S /desktopicon=no /quicklaunchicon=no" -WindowStyle Hidden -IgnoreExitCodes "1,2,3"
            } Else {
                Execute-Process -FilePath "Wireshark-win32-1.12.3.exe" -Arguments "/S /desktopicon=no /quicklaunchicon=no" -WindowStyle Hidden -IgnoreExitCodes "1,2,3"
            }
        
        
        ##*===============================================
        ##* POST-INSTALLATION
        ##*===============================================
        [string]$installPhase = 'Post-Installation'

            ## <Perform Post-Installation tasks here>
    
            ## Display a message at the end of the install
            Show-InstallationPrompt -Message "The installation of $appName $appVersion complete." -ButtonRightText 'OK' -Icon Information -NoWait
    }
    ElseIf ($DeploymentType -ieq 'Uninstall')
    {
        ##*===============================================
        ##* PRE-UNINSTALLATION
        ##*===============================================
        [string]$installPhase = 'Pre-Uninstallation'
        
        If (Get-InstalledApplication -Name "Wireshark 1.12.3 (64-bit)") { 
        # Show Welcome Message, close Internet Explorer if required with a 60 second countdown before automatically closing
        Show-InstallationWelcome -CloseApps "wireshark,op_flse,aceanalyst" -CloseAppsCountdown "60"
    
        # Show Progress Message (with the default message)
        Show-InstallationProgress
                    
        ##*===============================================
        ##* UNINSTALLATION
        ##*===============================================
        [string]$installPhase = 'Uninstallation'
        
        # <Perform Uninstallation tasks here>
        if ($is64Bit -eq $true) {
            Execute-Process -FilePath "$envProgramFiles\Wireshark\uninstall.exe" -Arguments "/S" -WindowStyle Hidden -IgnoreExitCodes "1,2,3"
            } Else {
            Execute-Process -FilePath "$envProgramFilesX86\Wireshark\uninstall.exe" -Arguments "/S" -WindowStyle Hidden -IgnoreExitCodes "1,2,3"
            }
        
            #Display a message at the end of the uninstall
            Show-InstallationPrompt -Message "The uninstallation of $appName $appVersion complete." -ButtonRightText 'OK' -Icon Information -NoWait     
        } else {
            Show-InstallationPrompt -Message "$appName $appVersion is not installed." -ButtonRightText 'OK' -Icon Information -NoWait; Write-Log "ErrorCode Return value is: 1605, proceeding."; Exit-Script -ExitCode 1605
            }
        
        
        ##*===============================================
        ##* POST-UNINSTALLATION
        ##*===============================================
        [string]$installPhase = 'Post-Uninstallation'
        
        ## <Perform Post-Uninstallation tasks here>
    }
    
    ##*===============================================
    ##* END SCRIPT BODY
    ##*===============================================
    
    ## Call the Exit-Script function to perform final cleanup operations
    Exit-Script -ExitCode $mainExitCode
}
Catch {
    [int32]$mainExitCode = 1
    [string]$mainErrorMessage = "$(Resolve-Error)"
    Write-Log -Message $mainErrorMessage -Severity 3 -Source $deployAppScriptFriendlyName
    Show-DialogBox -Text $mainErrorMessage -Icon 'Stop'
    Exit-Script -ExitCode $mainExitCode
}