Get-FileVersion returns error on FR W10 X64

Hi All,

I tested part of the code from Get-FileVersion(the part of the code which retrieves the file version) because I wanted to use it as part of an application’s detection method and compare the lower ends of it to the version targeted by the deployment, and it errored out.

PSADT code:
				$fileVersion = (Get-Command -Name $file -ErrorAction 'Stop').FileVersionInfo.FileVersion
				If ($fileVersion) {
					## Remove product information to leave only the file version
					$fileVersion = ($fileVersion -split ' ' | Select-Object -First 1)
My proposed code:
				$fileVersion = (Get-Command -Name $file -ErrorAction 'Stop').FileVersionInfo.FileVersionRaw
				If ($fileVersion) {
					## Remove product information to leave only the file version

Thank you for all the effort put so far into this software.

Below text is from prod:

<![LOG[[Installation] :: File version is [2,].]LOG]!><time="15:11:51.24160" date="12-10-2020" component="Get-FileVersion" context="AUTORITE NT\Système" type="1" thread="11864" file="Deploy-Application.ps1">
<![LOG[[Installation] :: Error Record:
-------------

Message        : Impossible de convertir la valeur «2,» en type «System.Version». Erreur: «La portion de la chaîne 
                 version était trop courte ou trop longue.»
InnerException : System.Management.Automation.PSInvalidCastException: Impossible de convertir la valeur «2,» en type «
                 System.Version». Erreur: «La portion de la chaîne version était trop courte ou trop longue.» ---> 
                 System.ArgumentException: La portion de la chaîne version était trop courte ou trop longue.
                    à System.Version.VersionResult.SetFailure(ParseFailureKind failure, String argument)
                    à System.Version.TryParseVersion(String version, VersionResult& result)
                    à System.Version.Parse(String input)
                    --- Fin de la trace de la pile d'exception interne ---
                    à 
                 System.Management.Automation.LanguagePrimitives.ConvertViaParseMethod.ConvertWithoutCulture(Object 
                 valueToConvert, Type resultType, Boolean recursion, PSObject originalValueToConvert, IFormatProvider 
                 formatProvider, TypeTable backupTable)
                    à System.Management.Automation.LanguagePrimitives.ConversionData`1.Invoke(Object valueToConvert, 
                 Type resultType, Boolean recurse, PSObject originalValueToConvert, IFormatProvider formatProvider, 
                 TypeTable backupTable)
                    à System.Management.Automation.LanguagePrimitives.ConvertTo(Object valueToConvert, Type 
                 resultType, Boolean recursion, IFormatProvider formatProvider, TypeTable backupTypeTable)
                    à System.Management.Automation.ArgumentTypeConverterAttribute.Transform(EngineIntrinsics 
                 engineIntrinsics, Object inputData, Boolean bindingParameters, Boolean bindingScriptCmdlet)

FullyQualifiedErrorId : RuntimeException
ScriptStackTrace      : à <ScriptBlock>, C:\WINDOWS\ccmcache\s\Deploy-Application.ps1 : ligne 124
                        à <ScriptBlock>, <Aucun fichier> : ligne 1
                        à <ScriptBlock>, <Aucun fichier> : ligne 1

PositionMessage : Au caractère C:\WINDOWS\ccmcache\s\Deploy-Application.ps1:124 : 5
                  + ...             [version]$Version = Get-FileVersion -File "$envProgramFil ...
                  +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Error Inner Exception(s):
-------------------------

Message        : Impossible de convertir la valeur «2,» en type «System.Version». Erreur: «La portion de la chaîne 
                 version était trop courte ou trop longue.»
InnerException : System.ArgumentException: La portion de la chaîne version était trop courte ou trop longue.
                    à System.Version.VersionResult.SetFailure(ParseFailureKind failure, String argument)
                    à System.Version.TryParseVersion(String version, VersionResult& result)
                    à System.Version.Parse(String input)



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Message        : La portion de la chaîne version était trop courte ou trop longue.
InnerException : **strong text**

what toolkit version did you use?

I used the 3.8.0 version of the toolkit.

This function has been reworked in one of the next versions. Please update your toolkit.