Skip to content

Get-FileHash holds the file open #12473

@HumanEquivalentUnit

Description

@HumanEquivalentUnit
Get-ChildItem | Get-FileHash | Rename-Item -NewName {$_.Hash}

Expected behaviour: the file is renamed.
Actual behaviour: An exception Rename-Item : The process cannot access the file because it is being used by another process.

Get-FileHash writes output to the pipeline before closing the file handle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions