GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Mrdrwest issue#66 bugfix by mrdrwest · Pull Request #68 · PowerShell/Microsoft.PowerShell.Archive

Conversation

@mrdrwest

@mrdrwest dwest (mrdrwest) commented Feb 18, 2019

Copy link
Copy Markdown

Modified script to process hidden files. Added -Force switch to the (only) Get-ChildItem cmdlet and the Get-Item cmdlet with the LastWriteTime member property.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Darrick West added 4 commits February 18, 2019 11:04
Darrick West
mrdrwest-hidden-files-bugfix
f61eedc
Darrick West
mrdrwest-psanalyzer-cleanup-suggestions
c18387d
Darrick West
mrdrwest change System.IO.FileMode::Open to OpenOrCreate to handle hi…
564a6ba
…dden files
Darrick West
mrdrwest-modified script to process hidden files
f80e2ee
@msftclas

Microsoft Contribution License Agreements (msftclas) commented Feb 18, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mrdrwest

dwest (mrdrwest) commented Feb 18, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Author

The modification processes hidden files, but it does not preserve the compressed files Hidden attribute in the zip archive.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mrdrwest
Merge branch 'master' into mrdrwest-issue#66-bugfix
e576fae
mrdrwest
dwest (mrdrwest) commented Aug 7, 2019
View reviewed changes

@mrdrwest dwest (mrdrwest) left a comment

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resubmitted due to build failure.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
KirkMunro
Kirk Munro (KirkMunro) suggested changes Aug 7, 2019
View reviewed changes

@KirkMunro Kirk Munro (KirkMunro) left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR. It's off to a good start, but I left some comments about whitespace changes that should be undone, and I tried to answer the question you left in a comment.

Also, for this PR to be accepted, additional Pester tests should be added to verify that it works on Windows/macOS/Linux, archiving hidden files and restoring them as hidden.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1
$createdItem = New-Item -Path $DestinationPath -ItemType Directory -Confirm:$isConfirm -Verbose:$isVerbose -ErrorAction Stop
if($createdItem -ne $null -and $createdItem.PSProvider.Name -ne "FileSystem")
if($null -ne $createdItem -and $createdItem.PSProvider.Name -ne "FileSystem")
{

@KirkMunro Kirk Munro (KirkMunro) Aug 7, 2019

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR, and for some of the best practice changes. It is very much appreciated.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1
$archiveFileStream = New-Object -TypeName System.IO.FileStream -ArgumentList $archiveFileStreamArgs

$zipArchiveArgs = @($archiveFileStream, [System.IO.Compression.ZipArchiveMode]::Update, $false)

@KirkMunro Kirk Munro (KirkMunro) Aug 7, 2019

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you have additional whitespace changes in the PR that shouldn't be included. Can you please remove them?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1
$zipArchive = New-Object -TypeName System.IO.Compression.ZipArchive -ArgumentList $zipArchiveArgs

$currentEntryCount = 0

@KirkMunro Kirk Munro (KirkMunro) Aug 7, 2019

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto on whitespace changes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1
$relativeFilePath = [System.IO.Path]::GetFileName($currentFilePath)
}

# Update mode is selected.

@KirkMunro Kirk Munro (KirkMunro) Aug 7, 2019

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto on whitespace changes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1
$srcStream = New-Object System.IO.BinaryReader $currentFileStream

$entryPath = DirectorySeparatorNormalizeHelper $relativeFilePath

@KirkMunro Kirk Munro (KirkMunro) Aug 7, 2019

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto on whitespace changes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1
{
$destStream.Write($buffer, 0, $numberOfBytesRead)
$destStream.Write($buffer, 0, $numberOfBytesRead) # can file attributes be specified here
$destStream.Flush()

@KirkMunro Kirk Munro (KirkMunro) Aug 7, 2019

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To address your comment, looking at the docs it seems that each ZipArchiveEntry has an ExternalAttributes property that is OS and application dependent. I would start testing with that property, see what is captured in it when an archive is created, and what can be restored when an archive is extracted.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@KirkMunro Kirk Munro (KirkMunro) added the waiting on author label Aug 19, 2019
@TravisEz13

Travis Plunk (TravisEz13) commented Jul 7, 2022

Copy link
Copy Markdown
Member

/azp run PowerShell.Microsoft.PowerShell.Archive

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@azure-pipelines

azure-pipelines Bot commented Jul 7, 2022

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@KirkMunro Kirk Munro (KirkMunro) KirkMunro requested changes
Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

waiting on author

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@mrdrwest @msftclas @TravisEz13 @KirkMunro
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.