This project is read-only.

Get-MSIFileType

Synopsis

Gets the Windows Installer file type.

Syntax

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

Get-MSIFileType -LiteralPath <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|
Accepts pipeline input? true (ByPropertyName)
Accept wildcard charactrs? 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|
Accepts pipeline input? false
Accept wildcard charactrs? 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|
Accepts pipeline input? true (ByValue, ByPropertyName)
Accept wildcard charactrs? true

Outputs

  • string: If -passthru is not specified, Get-MSIFileType returns an string object.
  • System.IO.DirectoryInfo: If -passthru is specified and the input object is a directory, the directory is returned.
  • System.IO.FileInfo: If -passthru is specified and the input object is a file, the file is returned.

Examples

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


Last edited Jul 2, 2013 at 7:53 AM by heaths, version 1

Comments

No comments yet.