Reimplement RunInfo plugin's deep_clone function for PowerShell 7.4+ compatibility #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #38.
While I've only observed a maximum depth of 16 members locally for my packages, I went with a maximum depth of 32 to provide room for possible future expansion before we need to worry about AU-imposed truncation.
Testing
For validation purposes, this change was manually patched into an existing
AU
v2022.10.24 installation (as this issue came up prior tochocolatey-au
's first release).The following files were patched:
%PROGRAMFILES%\WindowsPowerShell\Modules\AU\Plugins\RunInfo.ps1
%USERPROFILE%\PowerShell\Modules\AU\2022.10.24\Plugins\RunInfo.ps1
Executed
update_all.ps1
from my local repository based onau-packages-template
to invoke the Plugin from Windows PowerShell 5.0 (within a clean VM built around Windows 10 Pro v1507, 64-bit), Windows PowerShell 5.1 and PowerShell 7.4 (both from my dev environment: Windows 11 Pro 22H2).Compared the resulting
update_info.xml
files and looked for notable serialization differences from a pre-patched run. Nothing jumped out at me as being potentially problematic.