Passing Parameters into Powershell

I have a working script for testing:

$Array = ‘(404) 343-2714’, ‘(508) 468-7328’, ‘(774) 722-4747’, ‘(862) 485-4011’, ‘’, ‘(207) 439-6313’, ‘’, ‘’, ‘(817) 808-7579’
$String = ‘(817) 808-7579’
$Index = $Array.IndexOf($String)
$Index -as [String]

Which returns the correct index of 8

However when doing the same thing but passing the variables in as parameters from UiPath:

Param(
[String]$Array, [String]$String
)
$Index = $Array.IndexOf($String)
$Index -as [String]

It returns an index of -1

image
image

Anyone know what UiPath could be changing when passing in the variables to cause this?

Hi @ScarlettRogue,
This topic should help you:

1 Like