Skip to content

Commit 14df99e

Browse files
committed
implement Write-PSFHostColor
1 parent d9e01f9 commit 14df99e

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

PSModuleDevelopment/functions/utility/Show-PSMDSyntax.ps1

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,10 @@
130130
$null = $sb.Append("<c='$color'>-$($parameter.Name)</c>")
131131

132132
if ($parmFoundInCommandText) {
133-
$color = "$colorFoundAsterisk"
134-
$null = $sb.Append("<c='$color'>* </c>")
133+
$null = $sb.Append("<c='$colorFoundAsterisk'>* </c>")
135134
}
136135
elseif ($parameter.IsMandatory -eq $true) {
137-
$color = "$colorNotFoundAsterisk"
138-
$null = $sb.Append("<c='$color'>* </c>")
136+
$null = $sb.Append("<c='$colorNotFoundAsterisk'>* </c>")
139137
}
140138
else {
141139
$null = $sb.Append(" ")
@@ -147,7 +145,7 @@
147145
}
148146

149147
$null = $sb.AppendLine("")
150-
Write-PSFMessage -Level Host -Message "$($sb.ToString())"
148+
Write-PSFHostColor -String "$($sb.ToString())"
151149
}
152150

153151
$null = $sbHelp.AppendLine("")
@@ -183,7 +181,7 @@
183181
}
184182

185183
$null = $sb.AppendLine("")
186-
Write-PSFMessage -Level Host -Message "$($sb.ToString())"
184+
Write-PSFHostColor -String "$($sb.ToString())"
187185
}
188186

189187
$null = $sbHelp.AppendLine("")
@@ -196,10 +194,10 @@
196194
}
197195

198196
if ($sbParmsNotFound.Length -gt 0) {
199-
Write-PSFMessage -Level Host -Message "$($sbParmsNotFound.ToString())"
197+
Write-PSFHostColor -String "$($sbParmsNotFound.ToString())"
200198
}
201199

202-
if ($IncludeHelp) {
203-
Write-PSFMessage -Level Host -Message "$($sbHelp.ToString())"
200+
if ($Legend) {
201+
Write-PSFHostColor -String "$($sbHelp.ToString())"
204202
}
205203
}

0 commit comments

Comments
 (0)