Public/Uninstall-P1Msi.ps1

function Uninstall-P1Msi {
    <#
    .Synopsis
    Uninstall a legacy MSI installation of PlannerOne.
 
    .Description
    Read Windows registry base for uninstall key and uninstall from PlannerOne from MSI.
    Call Get-P1MsiInstall and use PSChildName key to uninstall with this command.
 
    .Parameter UninstallKey
    The MSI uninstall key.
     
    #>

    [cmdletbinding()]
    param(
    [Parameter(Mandatory=$true)]
    [string] $UninstallKey
    )    
    Process {
    # Out-Null is here for synchronous exe call
    . msiexec /x $UninstallKey /quiet | Out-Null
    }
}