Skip to content

Commit feaa5dc

Browse files
feat: Write-TypeView - Escaping Typenames that are invalid XML ( Fixes #222 )
1 parent 9bc2ba3 commit feaa5dc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Commands/Types.PS1XML/Write-TypeView.ps1

+3
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ if (`$Eventhandler -is [Management.Automation.PSEventSubscriber]) {
187187
if ($Deserialized -and $TypeName -notlike 'Deserialized.*') {
188188
$typeName =
189189
foreach ($tn in $TypeName) {
190+
if (-not ("<TypeName>$tn</TypeName>" -as [xml])) {
191+
$tn = [Security.SecurityElement]::Escape($tn)
192+
}
190193
$tn, "Deserialized.$tn"
191194
}
192195
}

0 commit comments

Comments
 (0)