Microsoft.PowerShell.Archive icon indicating copy to clipboard operation
Microsoft.PowerShell.Archive copied to clipboard

Support parameter to correctly date files when expanding an archive

Open ayousuf23 opened this issue 2 years ago • 1 comments

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 avatar Jul 25 '22 19:07 ayousuf23

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

ayousuf23 avatar Jul 25 '22 19:07 ayousuf23