Skip to main content

Get-FileVersion

SYNOPSISโ€‹

Gets the version of the specified file

SYNTAXโ€‹

Get-FileVersion [-File] <String> [-ProductVersion] [[-ContinueOnError] <Boolean>] [<CommonParameters>]

DESCRIPTIONโ€‹

Gets the version of the specified file

EXAMPLESโ€‹

EXAMPLE 1โ€‹

Get-FileVersion -File "$envProgramFilesX86\Adobe\Reader 11.0\Reader\AcroRd32.exe"

PARAMETERSโ€‹

-Fileโ€‹

Path of the file

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProductVersionโ€‹

Switch that makes the command return ProductVersion instead of FileVersion

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-ContinueOnErrorโ€‹

Continue if an error is encountered. Default is: $true.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: True
Accept pipeline input: False
Accept wildcard characters: False

CommonParametersโ€‹

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTSโ€‹

Noneโ€‹

You cannot pipe objects to this function.โ€‹

OUTPUTSโ€‹

System.Stringโ€‹

Returns the version of the specified file.โ€‹

NOTESโ€‹

https://psappdeploytoolkit.com