Skip to content

Get‑FileVersion

dscbot edited this page Dec 19, 2025 · 1 revision

SYNOPSIS

Returns the version information for a file.

SYNTAX

Get-FileVersion [-Path] <FileInfo> [<CommonParameters>]

DESCRIPTION

Returns the version information for a file including the product version, file version, and other version-related metadata.

EXAMPLES

EXAMPLE 1

Get-FileVersion -Path 'E:\setup.exe'

Returns the version information for the file setup.exe.

EXAMPLE 2

Get-Item -Path 'E:\setup.exe' | Get-FileVersion

Returns the version information for the file setup.exe using pipeline input.

EXAMPLE 3

'E:\setup.exe' | Get-FileVersion

Returns the version information for the file setup.exe using pipeline input.

PARAMETERS

-Path

Specifies the file for which to return the version information.

Type: FileInfo
Parameter Sets: (All)
Aliases: FullName

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
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

System.IO.FileInfo

Accepts a file path via the pipeline.

System.String

Accepts a string path via the pipeline.

OUTPUTS

System.Diagnostics.FileVersionInfo

Returns the file version information.

NOTES

RELATED LINKS

Clone this wiki locally