Added constructor to ScriptLine
This commit is contained in:
@@ -19,13 +19,7 @@ class MonitoredScript
|
||||
$lineNumber = 0
|
||||
foreach($command in ( Get-Content -Path $Path ))
|
||||
{
|
||||
$this.Line.Add(
|
||||
[ScriptLine]@{
|
||||
Text = $command
|
||||
Path = $path
|
||||
LineNumber = $lineNumber
|
||||
}
|
||||
)
|
||||
$this.Line.Add( [ScriptLine]::New($command, $path, $lineNumber) )
|
||||
$lineNumber++
|
||||
}
|
||||
$this.LinesOfCode = $this.Line.Count
|
||||
|
||||
@@ -10,13 +10,22 @@ class ScriptLine
|
||||
[string] $Path
|
||||
[string] $Text
|
||||
[System.Collections.ArrayList]$Executions
|
||||
hidden [hashtable]$LastNode = $null
|
||||
hidden [hashtable]$LastNode = @{}
|
||||
|
||||
ScriptLine()
|
||||
{
|
||||
$Executions = New-Object 'System.Collections.ArrayList'
|
||||
$this.Executions = New-Object 'System.Collections.ArrayList'
|
||||
}
|
||||
|
||||
ScriptLine($Command, $Path, $LineNumber)
|
||||
{
|
||||
$this.Executions = New-Object 'System.Collections.ArrayList'
|
||||
$this.Text = $Command
|
||||
$this.Path = $Path
|
||||
$this.LineNumber = $LineNumber
|
||||
}
|
||||
|
||||
|
||||
[void]AddExecutionTime([float]$Milliseconds)
|
||||
{
|
||||
$this.LastNode.Milliseconds = $Milliseconds
|
||||
|
||||
Reference in New Issue
Block a user