<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://powershell.com/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>PowerShell General</title><link>http://powershell.com/cs/forums/230.aspx</link><description>Moderated by PowerShell MVP &lt;a href="http://powershell.com/cs/content/experts.aspx#thomas-lee"&gt;Thomas Lee&lt;/a&gt; and PowerShell expert  &lt;a href="http://powershell.com/cs/content/experts.aspx#jakub-jares"&gt;Jakub Jareš&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>Re: Is it possible to use NOT LIKE in WQL when using Get-WMIOBJECT</title><link>http://powershell.com/cs/forums/thread/16413.aspx</link><pubDate>Mon, 07 May 2012 15:41:12 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:16413</guid><dc:creator>RSiddaway</dc:creator><slash:comments>0</slash:comments><comments>http://powershell.com/cs/forums/thread/16413.aspx</comments><wfw:commentRss>http://powershell.com/cs/forums/commentrss.aspx?SectionID=230&amp;PostID=16413</wfw:commentRss><description>&lt;p&gt;Couple of points on timing PowerShell statements:&lt;/p&gt;
&lt;p&gt;first run the timing a good number of times - I generally use 100 - to even out fluctuations in machine performance&lt;/p&gt;
&lt;p&gt;second in this case I suspect that the difference is due to the way PowerShell interprets the brackets and their contents - you generally don&amp;#39;t need them in WQL&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: Is it possible to use NOT LIKE in WQL when using Get-WMIOBJECT</title><link>http://powershell.com/cs/forums/thread/16412.aspx</link><pubDate>Mon, 07 May 2012 08:42:41 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:16412</guid><dc:creator>JoB</dc:creator><slash:comments>0</slash:comments><comments>http://powershell.com/cs/forums/thread/16412.aspx</comments><wfw:commentRss>http://powershell.com/cs/forums/commentrss.aspx?SectionID=230&amp;PostID=16412</wfw:commentRss><description>&lt;p&gt;Hello &lt;/p&gt;
&lt;p&gt;Actually I just checked and the statement without the inner set of brackets in 5 milliseconds faster&lt;/p&gt;
&lt;p&gt;Jo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: Is it possible to use NOT LIKE in WQL when using Get-WMIOBJECT</title><link>http://powershell.com/cs/forums/thread/16397.aspx</link><pubDate>Sun, 06 May 2012 10:37:11 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:16397</guid><dc:creator>JoB</dc:creator><slash:comments>0</slash:comments><comments>http://powershell.com/cs/forums/thread/16397.aspx</comments><wfw:commentRss>http://powershell.com/cs/forums/commentrss.aspx?SectionID=230&amp;PostID=16397</wfw:commentRss><description>&lt;p&gt;Thanks very much Richard, so that&amp;#39;s how you do it like you way not too obvious. For ease of reading I will use this&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Get-WmiObject&amp;nbsp; -query &amp;quot;select SerialNumber FROM win32_bios WHERE NOT (SerialNumber LIKE &amp;#39;to be filled by O.E.M%&amp;#39;)&amp;quot;&lt;/p&gt;
&lt;p&gt;Jo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Re: Is it possible to use NOT LIKE in WQL when using Get-WMIOBJECT</title><link>http://powershell.com/cs/forums/thread/16396.aspx</link><pubDate>Sun, 06 May 2012 10:19:06 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:16396</guid><dc:creator>RSiddaway</dc:creator><slash:comments>0</slash:comments><comments>http://powershell.com/cs/forums/thread/16396.aspx</comments><wfw:commentRss>http://powershell.com/cs/forums/commentrss.aspx?SectionID=230&amp;PostID=16396</wfw:commentRss><description>&lt;p&gt;Try this&lt;/p&gt;
&lt;p&gt;Get-WmiObject -Query &amp;quot;SELECT SerialNumber FROM Win32_Bios WHERE NOT SerialNumber LIKE &amp;#39;to be filled by O.E.M%&amp;#39;&amp;quot;&lt;/p&gt;
&lt;p&gt;Notice where the NOT sits in the syntax - not intuitive&lt;/p&gt;
&lt;p&gt;This also works&lt;/p&gt;
&lt;p&gt;Get-WmiObject -Class&amp;nbsp; Win32_Bios&amp;nbsp; -Filter &amp;quot;NOT SerialNumber LIKE &amp;#39;to be filled by O.E.M%&amp;#39;&amp;quot; -Property SerialNumber&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Is it possible to use NOT LIKE in WQL when using Get-WMIOBJECT</title><link>http://powershell.com/cs/forums/thread/16395.aspx</link><pubDate>Sun, 06 May 2012 09:46:40 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:16395</guid><dc:creator>JoB</dc:creator><slash:comments>0</slash:comments><comments>http://powershell.com/cs/forums/thread/16395.aspx</comments><wfw:commentRss>http://powershell.com/cs/forums/commentrss.aspx?SectionID=230&amp;PostID=16395</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I canot see a way to use a NOT LIKE statement in WQL for example&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;font-size:12pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-ansi-language:EN-GB;mso-fareast-language:EN-GB;mso-bidi-language:AR-SA;"&gt;Get-WmiObject&amp;nbsp; -query &amp;quot;select SerialNumber FROM win32_bios WHERE SerialNumber LIKE &amp;#39;to be filled by O.E.M%&amp;#39;&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;font-size:12pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-ansi-language:EN-GB;mso-fareast-language:EN-GB;mso-bidi-language:AR-SA;"&gt;Gets my BIOS Serial Number as it is set to, to be filled by O.E.M&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;font-size:12pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-ansi-language:EN-GB;mso-fareast-language:EN-GB;mso-bidi-language:AR-SA;"&gt;However I want to say WHERE NOT LIKE, I see you can you &amp;lt;&amp;gt; or != for non strings. However there does not appear to be a NOTLIKE or [NOT]LIKE in WQL &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;font-size:12pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-ansi-language:EN-GB;mso-fareast-language:EN-GB;mso-bidi-language:AR-SA;"&gt;I know I could do this for example&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;font-size:12pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-ansi-language:EN-GB;mso-fareast-language:EN-GB;mso-bidi-language:AR-SA;"&gt;&amp;nbsp;(Get-WMIOBJECT Win32_BIOS).SerialNumber | where {$_ -notmatch &amp;quot;^to be filled by O.E.M&amp;quot;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;font-size:12pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-ansi-language:EN-GB;mso-fareast-language:EN-GB;mso-bidi-language:AR-SA;"&gt;However lets say I have 1000 computers, I would have to pass all of there SerialNumbers down the pipline then filter, I wanted early filtering with WQL&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;font-size:12pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-ansi-language:EN-GB;mso-fareast-language:EN-GB;mso-bidi-language:AR-SA;"&gt;is there a&amp;nbsp;WQL&amp;nbsp;sollution to the&amp;nbsp;above?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;font-size:12pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-ansi-language:EN-GB;mso-fareast-language:EN-GB;mso-bidi-language:AR-SA;"&gt;Thanks All&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;font-size:12pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-ansi-language:EN-GB;mso-fareast-language:EN-GB;mso-bidi-language:AR-SA;"&gt;Jo&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;Times New Roman&amp;#39;,&amp;#39;serif&amp;#39;;font-size:12pt;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;mso-ansi-language:EN-GB;mso-fareast-language:EN-GB;mso-bidi-language:AR-SA;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>