-
Notifications
You must be signed in to change notification settings - Fork 39
Closed
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest version
- Search the existing issues.
Steps to reproduce
I had a string variable named $srcStream declared before calling Expand-Archive, because of that I was getting this error:
Method invocation failed because [System.String] does not contain a method named 'Dispose'.
The problematic code is in Microsoft.PowerShell.Archive.psm1, where $srcStream gets disposed.
To reproduce:
$srcStream = "whatever"
Expand-Archive -Path "arc.zip"Expected behavior
Archive gets extractedActual behavior
Extraction failsError details
Method invocation failed because [System.String] does not contain a method named 'Dispose'.
At C:\windows\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Archive\Microsoft.PowerShell.Archive.psm1:1077 char:25
+ $srcStream.Dispose()
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFoundEnvironment data
Name Value
---- -----
PSVersion 7.2.3
PSEdition Core
GitCommitId 7.2.3
OS Microsoft Windows 10.0.19042
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Version
7.2.3
Visuals
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels