Skip to content

Commit

Permalink
feat: Write-TypeView - Escaping Typenames that are invalid XML ( Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
StartAutomating committed Jul 7, 2024
1 parent 9bc2ba3 commit feaa5dc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Commands/Types.PS1XML/Write-TypeView.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ if (`$Eventhandler -is [Management.Automation.PSEventSubscriber]) {
if ($Deserialized -and $TypeName -notlike 'Deserialized.*') {
$typeName =
foreach ($tn in $TypeName) {
if (-not ("<TypeName>$tn</TypeName>" -as [xml])) {
$tn = [Security.SecurityElement]::Escape($tn)
}
$tn, "Deserialized.$tn"
}
}
Expand Down

0 comments on commit feaa5dc

Please sign in to comment.