Public/Get-specTVRegistryPath.ps1

Function Get-specTVRegistryPath {
    <#
    .SYNOPSIS
        Determines and returns the appropriate top level registry path based (x64 or x86) required for Team Viewer management.
 
    .DESCRIPTION
        The Get-specTVRegistryPath function returns the corresponding top level registry path (64-bit or 32-bit) for querying TeamViewer configuration.
        This is useful when interacting with the TeamViewer registry settings.
 
    .PARAMETER GetBitPath
        Determines the registry path to return - either 64-bit path or 32-bit
 
    .EXAMPLE
        Get-specTVRegistryPath -GetBitPath 64-bit
        Determines the device architecture and returns the 64-bit registry path for querying TeamViewer configuration.
 
    .NOTES
        Author : owen.heaume
        Version : 1.0
 
    #>


    param (
        [parameter (mandatory = $true)]
        [ValidateSet ('32-bit', '64-bit')]
        [string]$GetBitPath
    )

    if ($GetBitPath -eq '64-bit') {
        $RegistryPath = "HKLM:\SOFTWARE\TeamViewer"
    } else {
        $RegistryPath = "HKLM:\SOFTWARE\WOW6432Node\TeamViewer"
    }

    write-output $RegistryPath
}