Scoop
Scoop copied to clipboard
[Bug] InvalidOperation errors during scoop update on PowerShell 7
Bug Report
Current Behavior
When running scoop update -a under PowerShell 7, every application update triggers an InvalidOperation exception.
It seems that $binaryReader or $fileStream can sometimes be null during the update process, and when Close() is called, the following error appears:
Expected Behavior
scoop update should complete without throwing InvalidOperation exceptions when using PowerShell 7.
Additional context/output
- Error does not happen in Windows PowerShell 5.1.
- Error is reproducible in a clean environment with only default Scoop configuration.
- Full update still succeeds, but the error messages are always shown.
Possible Solution
Add null checks before calling .Close() on $binaryReader and $fileStream, or ensure the objects are initialized correctly.
System details
Windows version: Windows 11 Pro build 26100.4349
OS architecture: 64bit
PowerShell version:
Name Value
---- -----
PSVersion 7.5.2
PSEdition Core
GitCommitId 7.5.2
OS Microsoft Windows 10.0.26100
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Scoop Configuration
{
"last_update": "2025-10-03T10:09:39.7374002+03:00",
"scoop_repo": "https://github.com/ScoopInstaller/Scoop",
"scoop_branch": "master",
"aria2-warning-enabled": false,
"alias": {
"upgrade": "scoop-upgrade"
},
"aria2-enabled": false
}