Public/Get-specRegistryPath.ps1

Function Get-specRegistryPath {
    <#
    .SYNOPSIS
        Determines and returns the appropriate registry path based (x64 or x86) required for Team Viewer management.
 
    .DESCRIPTION
        The Get-specRegistryPath function returns the corresponding 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-specRegistryPath -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\DeviceManagementV2"
    } else {
        $RegistryPath = "HKLM:\SOFTWARE\WOW6432Node\TeamViewer\DeviceManagementV2"
    }

    write-output $RegistryPath

}