Skip to content

Instantly share code, notes, and snippets.

View rafalcieslak's full-sized avatar

Rafał Cieślak rafalcieslak

View GitHub Profile
@rafalcieslak
rafalcieslak / portable-zip-pathnames.ps1
Created October 8, 2017 13:44 — forked from lantrix/portable-zip-pathnames.ps1
PowerShell encoding Zip paths to use forward slash (Zip Spec) instead of backslash (Windows Style); for portable zip files - thanks to @sethjackson
# When using System.IO.Compression.ZipFile.CreateFromDirectory in PowerShell, it still uses backslashes in the zip paths
# despite this https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/mitigation-ziparchiveentry-fullname-path-separator
# Based upon post by Seth Jackson https://sethjackson.github.io/2016/12/17/path-separators/
#
# PowerShell 5 (WMF5) & 6
# Using class Keyword https://msdn.microsoft.com/powershell/reference/5.1/Microsoft.PowerShell.Core/about/about_Classes
#