Skip to content

Commit 5c411f3

Browse files
amorphobianiheaven
authored andcommitted
fix(autoupdate): Copy PSCustomObject-type properties within autoupdate to prevent reference changes (#5934)
1 parent 947f4a4 commit 5c411f3

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Bug Fixes
44

55
- **scoop-search:** Catch error of parsing invalid manifest ([#5930](https://github.com/ScoopInstaller/Scoop/issues/5930))
6+
- **autoupdate:** Copy `PSCustomObject`-type properties within `autoupdate` to prevent reference changes ([#5934](https://github.com/ScoopInstaller/Scoop/issues/5934))
67

78
## [v0.4.1](https://github.com/ScoopInstaller/Scoop/compare/v0.4.0...v0.4.1) - 2024-04-25
89

lib/autoupdate.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ function Update-ManifestProperty {
365365
}
366366
} elseif ($Manifest.$currentProperty -and $Manifest.autoupdate.$currentProperty) {
367367
# Update other property (global)
368-
$autoupdateProperty = $Manifest.autoupdate.$currentProperty
368+
$autoupdateProperty = $Manifest.autoupdate.$currentProperty.PSObject.Copy()
369369
$newValue = substitute $autoupdateProperty $Substitutions
370370
if (($autoupdateProperty.GetType().Name -eq 'Object[]') -and ($autoupdateProperty.Length -eq 1)) {
371371
# Make sure it's an array

0 commit comments

Comments
 (0)