Get-MSIFileType

Synopsis

Gets the Windows Installer file type.

Syntax

  • Get-MSIFileType [-Path] <String[]> [-PassThru]
  • Get-MSIFileType [-LiteralPath] <String[]> [-PassThru]

Detailed Description

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

You can optionally add this MSIFileType property to FileSystem items.

Parameters

-Path <String[]>

Specifies the path to the item or items which must resolve to a file system path.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? true

-PassThru

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
Accept pipeline input? false
Accept wildcard characters? false

-LiteralPath <String[]>

Specifies 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? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

Return Type

  • System.String: If -passthru is not specified, Get-MSIFileType returns an string object.

Notes

Example 1

C:\PS> get-msifilehash -path $env:WINDIR\Installer

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

Example 2

C:\PS> 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

Last edited May 15, 2009 at 10:44 PM by heaths, version 1

Comments

No comments yet.