mirror of
https://github.com/actions/runner-images.git
synced 2025-12-12 03:57:32 +00:00
* Implement first version * fix tables rendering * Fix scripts * update test files * implement calculate image diff script * Polish code and make e2e validation * remove test files * render add and removed firstly
28 lines
705 B
PowerShell
28 lines
705 B
PowerShell
using module ./SoftwareReport.BaseNodes.psm1
|
|
using module ./SoftwareReport.Nodes.psm1
|
|
|
|
class SoftwareReport {
|
|
[HeaderNode] $Root
|
|
|
|
SoftwareReport([String] $Title) {
|
|
$this.Root = [HeaderNode]::new($Title)
|
|
}
|
|
|
|
SoftwareReport([HeaderNode] $Root) {
|
|
$this.Root = $Root
|
|
}
|
|
|
|
[String] ToJson() {
|
|
return $this.Root.ToJsonObject() | ConvertTo-Json -Depth 10
|
|
}
|
|
|
|
static [SoftwareReport] FromJson($jsonString) {
|
|
$jsonObj = $jsonString | ConvertFrom-Json
|
|
$rootNode = [NodesFactory]::ParseNodeFromObject($jsonObj)
|
|
return [SoftwareReport]::new($rootNode)
|
|
}
|
|
|
|
[String] ToMarkdown() {
|
|
return $this.Root.ToMarkdown(1).Trim()
|
|
}
|
|
} |