dividir strings en Powershell

dividir un string por un caracter:

$a = "powershell,jorge,windows"
$a.split(",")
powershell
jorge
windows

Seleccionar un elemento
$a.split(",")[1]
jorge

Dividir por un caracter, y limpiar los espacios en blanco:
$a = "powershell2 jorge2 windows"
$a.split("2")
powershell
jorge
windows

$a.split("2",[StringSplitOptions]::RemoveEmptyEntries)
powershell
jorge
windows

No hay comentarios.: