1 2 3 4 5 6 7 8 9 10 11 | $LongitudMax = 10 $Texto = 'Texto para acortar' if ($Texto.Length -gt $LongitudMax) { $Texto.Substring(0,$LongitudMax) + '...' } else { $Texto } |
1 2 3 4 5 6 7 8 9 10 11 | $LongitudMax = 10 $Texto = 'Texto para acortar' if ($Texto.Length -gt $LongitudMax) { $Texto.Substring(0,$LongitudMax) + '...' } else { $Texto } |