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 : MethodNotFound
Environment 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.0
Prerequisites
Steps to reproduce
I had a string variable named
$srcStream
declared before callingExpand-Archive
, because of that I was getting this error:The problematic code is in
Microsoft.PowerShell.Archive.psm1
, where$srcStream
gets disposed.To reproduce:
Expected behavior
Actual behavior
Error details
Environment data
Version
7.2.3
Visuals
No response