< Back

Get-MSIFileType

Sat Jan 18, 2020 4:44 pm

NAME Get-MSIFileType



SYNOPSIS

Gets the Windows Installer file type.





SYNTAX

Get-MSIFileType -LiteralPath <String[]> [-PassThru] [<CommonParameters>]



Get-MSIFileType [[-Path] <String[]>] [-PassThru] [<CommonParameters>]





DESCRIPTION

Gets the Windows Installer file type for a given file or files.



You can optionally add this MSIFileType property to FileSystem items.





PARAMETERS

-LiteralPath <String[]>

The path to the item or items which must resolve to a file system path. The value of -LiteralPath is used

exactly as typed. No characters are interpreted as wildcards.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-PassThru [<SwitchParameter>]

Passes the item or items passed into this cmdlet through the pipeline with the additional property for the

file type.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Path <String[]>

The path to the item or items which must resolve to a file system path. You can specify * in any part of the

path to select all matching files.



Required? false

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName, ByValue)

Accept wildcard characters? true



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

string





System.IO.DirectoryInfo





System.IO.FileInfo







NOTES









-------------------------- EXAMPLE 1 --------------------------



get-msifilehash -path $env:WINDIR\\Installer



This command outputs the file type of files in the Windows Installer cache directory.

-------------------------- EXAMPLE 2 --------------------------



get-childitem -path $env:WINDIR\\Installer\\* | where-object {$_.PSIsContainer -eq $False} | get-msifiletype

-passthru | format-table Name, MSIFileType -auto



This command outputs the Windows Installer file type for files in the Windows Installer cache directory.



RELATED LINKS

Get-MSIFileHash