Created
May 14, 2022 17:46
-
-
Save karlgluck/a71dc31e70e05688a8e03227325128c9 to your computer and use it in GitHub Desktop.
How to extract a single file from a ZIP archive using Powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ZipFilePath = "" | |
$FileNameInZip = "" | |
Add-Type -AssemblyName System.IO.Compression.FileSystem | |
$Zip = [System.IO.Compression.ZipFile]::OpenRead($ZipFilePath) | |
$Zip.Entries | | |
Where-Object { $_.Name -eq $FileNameInZip } | | |
ForEach-Object { | |
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $_.Name, $true) | |
} | |
$Zip.Dispose() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment