PowerShell / Microsoft.PowerShell.Archive

Archive PowerShell module contains cmdlets for working with ZIP archives
https://technet.microsoft.com/en-us/library/dn818910.aspx
MIT License
94 stars 37 forks source link

Support parameter to correctly date files when expanding an archive #133

Open ayousuf23 opened 2 years ago

ayousuf23 commented 2 years ago

Summary of the new feature / enhancement

There is a design flaw with Zip which goes back to its origins on MS DOS. It stores the date/time as displayed - i.e. as local time, not UTC time. And when the file is extracted, the time is set as local time. This means if compress and expand happen on machines with different time zone settings the time stamp on the files changes. Changing the file format to fix this is absolutely out of scope, however a -SourceTimeZone parameter could allow the unzip operation to create correctly dated files.

Taken from @jhoneill

Proposed technical implementation details (optional)

An optional named parameter -SourceTimeZone which takes in a timezone is added to Expand-Archive. When expanding an archive, the dates for each expanded file and directory are adjusted based on the specified timezone.

ayousuf23 commented 2 years ago

@jhoneill I made an issue for the feature you suggested.