< Back

Test-CZipFile

Sun Jan 12, 2020 11:36 pm

NAME Test-CZipFile



SYNOPSIS

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





SYNTAX

Test-CZipFile [-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.





PARAMETERS

-Path <String>

The path to the file to test.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



<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

System.Boolean





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



PS C:\\>Test-CZipFile -Path 'MyCoolZip.zip'



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











RELATED LINKS

https://www.nuget.org/packages/DotNetZip

Compress-CItem

Expand-CItem