Why won't a query like this work?
SELECT 'email@domain.com' AS email FROM Orion.Nodes
It is because the ampersand is reserved for query parameters.
#SWQL Query $query = "SELECT TOP 1 Caption, @email AS Email FROM Orion.Nodes "$params = @{email='yaquaholic@thwack.com'}
#PSSnapin presence check/addif (!(Get-PSSnapin -Name "SwisSnapin" -ErrorAction SilentlyContinue)) { Add-PSSnapin SwisSnapin -ErrorAction SilentlyContinue }
#Orion IP and user credentials $orion="10.0.0.1" $user = "yaquaholic"$passwd = "Like I would post this publicly"
# Define SWIS connection with credentials$swis = Connect-Swis -host $orion -UserName $user -Password $passwd
##And query and print results $results = Get-SwisData $swis $query $paramsecho $results
Hope it helps,
yaquaholic
This is great. I can build a set of params before the query. That actually makes the script I was working on easier. Thanks!
Ah, nice, I didn't realize that. Thank you for the quick reply!