You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we try to Compress a directory which has locked files (e.g. C:\Portable\KeePass\KeePass.XmlSerializers.dll), then we get an "Access Denied" exception.
It's completely save to backup such files, therefore please change in Microsoft.PowerShell.Archive.psm1
Good evening
If we try to Compress a directory which has locked files (e.g. C:\Portable\KeePass\KeePass.XmlSerializers.dll), then we get an "Access Denied" exception.
It's completely save to backup such files, therefore please change in Microsoft.PowerShell.Archive.psm1
$currentFileStream = [System.IO.File]::Open($currentFilePath, [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read)
to
$currentFileStream = [System.IO.File]::Open($currentFilePath, [System.IO.FileMode]::Open, [System.IO.FileAccess]::Read, [System.IO.FileShare]::Read)
so that Compress-Archive does not expect to get exclusive access to the source files.
Thanks a lot, kind regards, Thomas
The text was updated successfully, but these errors were encountered: