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 Nov 30, 2023
1 parent c28a2fd commit aef79d8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions AU/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 aef79d8

Please sign in to comment.