Private/Install/Get-PWSHYBKPIVInstallPath.ps1
|
function Get-PWSHYBKPIVInstallPath { <# .SYNOPSIS Returns the configured install path for the resolved architecture. .DESCRIPTION win64 resolves to installation.installPath (Program Files); win32 resolves to installation.installPathWow6432 (Program Files (x86)), matching how the Yubico MSI installs each architecture on a 64-bit Windows host. .PARAMETER Installation The Config.installation section, as returned by Read-PWSHYBKPIVConfigFile. .PARAMETER Architecture "win32" or "win64", as returned by Resolve-PWSHYBKPIVArchitecture. .OUTPUTS String. Full path to yubico-piv-tool.exe for the resolved architecture. .EXAMPLE Get-PWSHYBKPIVInstallPath -Installation $config.installation -Architecture 'win64' #> [CmdletBinding()] [OutputType([string])] param( [Parameter(Mandatory)] [PSCustomObject] $Installation, [Parameter(Mandatory)] [ValidateSet('win32', 'win64')] [string] $Architecture ) if ($Architecture -eq 'win32') { $Installation.installPathWow6432 } else { $Installation.installPath } } |