Skip to content

Get-WinEvent Not releasing file lock #3979

@matthastings

Description

@matthastings

Steps to reproduce

Using Get-WinEvent to parse an event tracing log (ETL) file causing the file to get locked past the point of use.


Get-WinEvent -Path testfile.etl -Oldest
Remove-Item -Force testfile.etl

Expected behavior

Testfile.etl should be deleted

Actual behavior

Produces an error that the file cannot be removed because it is being used by another process. Closing PowerShell is the only way to release the lock and then delete the file. 

Environment data

Name                           Value                                                                                   
----                           -----                                                                                   
PSVersion                      5.0.10586.117                                                                           
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                 
BuildVersion                   10.0.10586.117                                                                          
CLRVersion                     4.0.30319.17929                                                                         
WSManStackVersion              3.0                                                                                     
PSRemotingProtocolVersion      2.3                                                                                     
SerializationVersion           1.1.0.1                                                                                 

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.WG-Cmdletsgeneral cmdlet issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions