PowerShell script to access Oracle system views
What powershell syntax are you using?

If you do not enclose the select between single quotes, Powershell will treat it like a variable. If that's the problem, please try:

$command.CommandText = 'SELECT COUNT (*) AS COUNT FROM v$session'