This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

How to include a Where LIKE in powershell?

What's the trick to include a LIKE in powershell?  The same query works fine in SWQL studio.

PS U:\> Get-SwisData $swisdev 'select top 5 interfaces.caption from orion.npm.interfaces'
Local Netflow Source
GigabitEthernet0/0/0 · #LAN ph004-ch3-rta eth1/9
GigabitEthernet0/0/1 · #WAN ph004-ch3-pea
Crypto-Engine0/0/6 - Cr0/0/6
GigabitEthernet0 - Gi0

PS U:\> Get-SwisData $swisdev 'select top 5 interfaces.caption from orion.npm.interfaces where interfaces.caption like 'gig%''
Get-SwisData : Cannot bind parameter 'Parameters'. Cannot convert the "gig%" value of type "System.String" to type "System.Collections.Hashtable".
At line:1 char:113
+ ... ption from orion.npm.interfaces where interfaces.caption like 'gig%''
+ ~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-SwisData], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,SwisPowerShell.GetSwisData

nerengm_0-1591213279034.png