Tests if a file is a ZIP file using the DotNetZip library.
Test-ZipFile [-Path] <String> [<CommonParameters>]
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.
| Name | Type | Description | Required? | Pipeline Input | Default Value |
|---|---|---|---|---|---|
| Path | String | The path to the file to test. |
true | false |
Test-ZipFile -Path 'MyCoolZip.zip'
Demonstrates how to check the current directory if MyCoolZip.zip is really a ZIP file.