# Script works in VSCode & ISE but Not PS command line

**URL:** <https://forums.powershell.org/t/script-works-in-vscode-ise-but-not-ps-command-line/18749>\
**Category:** PowerShell Help\
**Created:** [March 6, 2022, 3:05am UTC](https://forums.powershell.org/t/script-works-in-vscode-ise-but-not-ps-command-line/18749 "2022-03-06T03:05:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BR549](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@BR549](https://forums.powershell.org/u/BR549)\
**Post date:** [March 6, 2022, 3:05am UTC](https://forums.powershell.org/t/script-works-in-vscode-ise-but-not-ps-command-line/18749/1 "2022-03-06T03:05:29Z")

</div>

$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!!

Gordon

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [March 6, 2022, 3:25am UTC](https://forums.powershell.org/t/script-works-in-vscode-ise-but-not-ps-command-line/18749/2 "2022-03-06T03:25:02Z")

</div>

Gordon,  
Welcome back to the forum. 👋🏽

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

> [@Welcome to the new PowerShell Forums](https://forums.powershell.org/t/welcome-to-the-new-powershell-forums/7/6):
>
> How to format code in [PowerShell.org](http://PowerShell.org) forums. [Codeformatting\_1]

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`?

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:18pm UTC](https://forums.powershell.org/t/script-works-in-vscode-ise-but-not-ps-command-line/18749/3 "2024-05-16T20:18:15Z")

</div>


