Suppose I have the following:
$CUBE_input = "ABC; DEF"
If i perform the following operation,
$($($CUBE_input.ToUpper() -split ';' -replace '(^\s+|\s+$)','' -replace '\s+',' ')[0])
I get ABC, and with [1], I get back DEF (with no leading space thanks to the regex), as expected
However, if i dont have a semicolon split string, e.g.
$CUBE_input = "ABC"
and perform this operation again: $($($CUBE_input.ToUpper() -split ';' -replace '(^\s+|\s+$)','' -replace '\s+',' ')[0])
I get back A
I need to make it so that whether there is a semicolon delimited string or not, it only output the word every time, no characters.
How do i accomplish this?