Skip to content

Commit 8e4c0d5

Browse files
author
Github Actions
committed
Enhance logging in Invoke-ExpressionWithLogging function by adding information output for both command strings and script blocks. This improves visibility into the execution process and aids in debugging.
1 parent 485c932 commit 8e4c0d5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

scripts/PSBuild.psm1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,8 +1568,12 @@ function Invoke-ExpressionWithLogging {
15681568
process {
15691569
# Convert command string to scriptblock if needed
15701570
if ($PSCmdlet.ParameterSetName -eq "Command" -and -not [string]::IsNullOrWhiteSpace($Command)) {
1571+
Write-Information "Executing command: $Command" -Tags $Tags
15711572
$ScriptBlock = [scriptblock]::Create($Command)
15721573
}
1574+
else {
1575+
Write-Information "Executing script block: $ScriptBlock" -Tags $Tags
1576+
}
15731577

15741578
if ($ScriptBlock) {
15751579
# Display the expression

0 commit comments

Comments
 (0)