functions/setup/Get-ManagementPathFromMsiLog.ps1

function Get-ManagementPathFromMsiLog {
    param (
        [string]$LogFilePath
    )

    $file = [System.IO.File]::OpenText($LogFilePath)
    try {
        while ($line = $file.ReadLine()) {
            if ($line -match 'Property\(S\): Management = (.+)') {
                $path = $matches[1]
                $file.Close()
                Write-Output $path
            }
        }
    }
    catch { }
    finally {
        if ($file) { $file.Close() }
    }
}