Skip to content

Commit

Permalink
feat: Override ToString for SourceInfo
Browse files Browse the repository at this point in the history
- the  `Stitch.SourceItemInfo` object will now output the content of
  the file when ToString() is called
  • Loading branch information
aldrichtr committed Dec 13, 2023
1 parent 843e708 commit 57df847
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/stitch/private/SourceInfo/Get-SourceItemInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,13 @@ function Get-SourceItemInfo {
}
}

[PSCustomObject]$sourceObject | Write-Output
$sourceInfo = [PSCustomObject]$sourceObject


$sourceInfo = $sourceInfo | Add-Member -MemberType ScriptMethod -Name ToString -Value {
Get-Content $this.Path } -Force -PassThru

$sourceInfo | Write-Output
} # end foreach
} # end process block
end {
Expand Down

0 comments on commit 57df847

Please sign in to comment.