In one of my script I have the following problem: assigning to a string variable the result of a function makes the string an array. Example:
$x=””
function findX{parm([string]prmx)
… some code here
$result=”abcd”
}
…
$x= findX “xy”
but if I look at it it’s
$x=1
abcd
and $x.Count is 2
I’ve made several runs, in step mode to try and find where the problem arise, but no way…
I can’t understand why…
Thanks for any help
PS: I’m a seasoned system engineer, I know various programming languages but I’m really a newbie with Powershell…
New contributor
user2256905 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.