Script works in VSCode & ISE but Not PS command line

$aLL = New-Object System.Collections.ArrayList
$aLL += $TideInfo | Where { $_ -contains $Today }

$TideInfo is also an array.

When run in ISE & VSCode it returns data from $TideINfo based on $Today - Correct!!!

When run at the PS command Line is returns all the data in $TideInfo

New to PS so Iā€™m confused as to whats going on?

Any - all help is greatly appreciated!!


Welcome back to the forum. :wave:t4:

When you post code or sample data or console output please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Thanks in advance

It will be hard to recommend something meaningful without seeing the relevant part of your code. How do you fill in whe variables $TideInfo and $Today?

1 Like