Skip to content

Commit

Permalink
Reimplement RunInfo plugin's deep_clone function for PowerShell 7.4+ …
Browse files Browse the repository at this point in the history
…compatibility
  • Loading branch information
brogers5 committed Mar 21, 2024
1 parent 4990b79 commit 72b2f40
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Plugins/RunInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ param(
function deep_clone {
param($DeepCopyObject)

$memStream = new-object IO.MemoryStream
$formatter = new-object Runtime.Serialization.Formatters.Binary.BinaryFormatter
$formatter.Serialize($memStream,$DeepCopyObject)
$memStream.Position=0
$formatter.Deserialize($memStream)
$serializedObject = [System.Management.Automation.PSSerializer]::Serialize($DeepCopyObject, 32)
[System.Management.Automation.PSSerializer]::Deserialize($serializedObject)
}

# Runinfo must save its own run results directly in Info
Expand Down

0 comments on commit 72b2f40

Please sign in to comment.