Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Powershell Invalid Query

$
0
0

I'm having problems with this script

http://pastebin.com/dsV5SHsM

 

It's a script written by Jeffrey Patton that pulls printer logs and dumps them to a csv file and to a sql database.

 

It's set to fire by scheduled task with this,

c:\scripts\New-PrintJob.ps1 -eventRecordID $(eventRecordID) -eventChannel $(eventChannel)

 

I'm getting an "invalid query" message with the newjob script.  the get print job works fine.  I've narrowed it down to 

 

$Event307 = Get-WinEvent -ErrorAction Stop -LogName $eventChannel -FilterXPath "<QueryList><Query Id='0' Path='$eventChannel'><Select Path='$eventChannel'>*[System[(EventRecordID=$eventRecordID)]]</Select></Query></QueryList>"

 

But I could be wrong.  Any tips?  Thanks!


Viewing all articles
Browse latest Browse all 6937

Trending Articles