Test-ZipFile

Tests if a file is a ZIP file using the DotNetZip library.

Syntax

Test-ZipFile [-Path] <String> [<CommonParameters>]

Description

Uses the Ionic.Zip.ZipFile.IsZipFile static method to determine if a file is a ZIP file. The file must exist. If it doesn't, an error is written and $null is returned.

You can pipe System.IO.FileInfo (or strings) to this function to filter multiple items.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
Path String

The path to the file to test.

true false

Return Values

System.Boolean.

EXAMPLE 1

Test-ZipFile -Path 'MyCoolZip.zip'

Demonstrates how to check the current directory if MyCoolZip.zip is really a ZIP file.