<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ByteCarrot&#187; ByteCarrot</title>
	<atom:link href="http://bytecarrot.com/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://bytecarrot.com</link>
	<description>The Open Source Configuration Validation Utility for Windows, Mac OS X and Linux</description>
	<lastBuildDate>Sat, 07 Aug 2010 14:39:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to check processor name using PowerShell</title>
		<link>http://bytecarrot.com/index.php/blog/check-processor-powershell/</link>
		<comments>http://bytecarrot.com/index.php/blog/check-processor-powershell/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 14:36:15 +0000</pubDate>
		<dc:creator>Marcin Obel</dc:creator>
				<category><![CDATA[Checks]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[PowerShellCheck]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://bytecarrot.com/?p=278</guid>
		<description><![CDATA[Information about processor can be retrieved using Microsoft&#8217;s WMI and PowerShell scripting language. In order to check name of processor execute following command in PowerShell console:

&#62;&#62; (Get-WmiObject Win32_Processor)[&#34;Name&#34;]

The command above can be used to create ByteCarrot&#8217;s check which will be able to validate for example if processor was made by Intel. Take a look at [...]]]></description>
			<content:encoded><![CDATA[<p>Information about processor can be retrieved using <strong>Microsoft&#8217;s WMI</strong> and <strong>PowerShell</strong> scripting language. In order to check name of processor execute following command in <strong>PowerShell </strong>console:</p>
<pre class="brush: xml;">
&gt;&gt; (Get-WmiObject Win32_Processor)[&quot;Name&quot;]
</pre>
<p>The command above can be used to create <strong>ByteCarrot</strong>&#8217;s check which will be able to validate for example if processor was made by <strong>Intel</strong>. Take a look at the script below:</p>
<pre class="brush: xml;">
&lt;PowerShellCheck&gt;
  &lt;Script&gt;
    &lt;![CDATA[
      $ProcessorName = (get-wmiobject Win32_Processor)[&quot;Name&quot;]
      if ($ProcessorName.Contains(&quot;Intel&quot;)) {
            return success &quot;The processor was made by Intel&quot;
      }
      return failure &quot;The processor was not made by Intel&quot;
    ]]&gt;
  &lt;/Script&gt;
&lt;/PowerShellCheck&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://bytecarrot.com/index.php/blog/check-processor-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to check BIOS manufacturer using PowerShell</title>
		<link>http://bytecarrot.com/index.php/blog/check-bios-manufacturer-powershell/</link>
		<comments>http://bytecarrot.com/index.php/blog/check-bios-manufacturer-powershell/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 14:23:16 +0000</pubDate>
		<dc:creator>Marcin Obel</dc:creator>
				<category><![CDATA[Checks]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[PowerShellCheck]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://bytecarrot.com/?p=272</guid>
		<description><![CDATA[Information about BIOS manufacturer can be retrieved using Microsoft&#8217;s WMI and PowerShell scripting language. In order to check its name execute following command in PowerShell console:

&#62;&#62; (get-wmiobject win32_bios)[&#34;Manufacturer&#34;]

The command above can be used to create ByteCarrot&#8217;s check which will be able to validate if BIOS manufacturer on your computer is for example &#8220;American Megatrends Inc.&#8221;. [...]]]></description>
			<content:encoded><![CDATA[<p>Information about BIOS manufacturer can be retrieved using Microsoft&#8217;s WMI and PowerShell scripting language. In order to check its name execute following command in PowerShell console:</p>
<pre class="brush: xml;">
&gt;&gt; (get-wmiobject win32_bios)[&quot;Manufacturer&quot;]
</pre>
<p>The command above can be used to create ByteCarrot&#8217;s check which will be able to validate if BIOS manufacturer on your computer is for example &#8220;American Megatrends Inc.&#8221;. Take a look at the script below:</p>
<pre class="brush: xml;">
&lt;PowerShellCheck&gt;
  &lt;Script&gt;
    &lt;![CDATA[
      $Manufacturer = (get-wmiobject win32_bios)[&quot;Manufacturer&quot;]
      if ($Manufacturer -like &quot;American Megatrends Inc.&quot;) {
	      return success &quot;BIOS was made by $Manufacturer&quot;
      }
      return failure &quot;BIOS was made by $Manufacturer&quot;
    ]]&gt;
  &lt;/Script&gt;
&lt;/PowerShellCheck&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://bytecarrot.com/index.php/blog/check-bios-manufacturer-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conditions &#8211; conditional execution in ByteCarrot</title>
		<link>http://bytecarrot.com/index.php/blog/conditions-conditional-execution-bytecarrot/</link>
		<comments>http://bytecarrot.com/index.php/blog/conditions-conditional-execution-bytecarrot/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 18:40:38 +0000</pubDate>
		<dc:creator>Marcin Obel</dc:creator>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[Conditions]]></category>
		<category><![CDATA[Example]]></category>

		<guid isPermaLink="false">http://bytecarrot.com/?p=264</guid>
		<description><![CDATA[ByteCarrot contains a functionality which allows executing groups of check conditionally. Current implementation of this feature is quite limited but still is able to help in many cases. Conditions verify if specified parameter is equal (==) or not equal (!=) to other parameter or static value. They can contain parameter names surrounded by $(&#8230;) or [...]]]></description>
			<content:encoded><![CDATA[<p><strong>ByteCarrot </strong>contains a functionality which allows executing groups of check conditionally. Current implementation of this feature is quite limited but still is able to help in many cases. Conditions verify if specified parameter <strong>is equal (==)</strong> or <strong>not equal (!=)</strong> to other parameter or static value. They can contain parameter names surrounded by <strong>$(&#8230;)</strong> or static values surrounded by <strong>quotas</strong> (&#8217;static value&#8217;). These elements can be mixed freely. Take a look at the examples below.</p>
<p>1. MyParameter is equal to 2:<br />
<strong> $(MyParameter) == &#8216;2&#8242;</strong></p>
<p>2. MyParameter is not equal to MyOtherParameter:<br />
<strong> $(MyParameter) != $(MyOtherParameter)</strong></p>
<p>3. Two static values can be also compared (but of course it does not make sense):<br />
<strong> &#8216;value 1&#8242; != &#8216;value 2&#8242;</strong></p>
<p>Conditions in ByteCarrot can be used only with <strong>&lt;Group /&gt;</strong> tag but fortunately this tag can be nested multiple times, so this should not be a problem. In order to add condition to a <em>group </em>decorate it with &#8220;<strong>Condition</strong>&#8221; attribute like in example shown below.</p>
<pre class="brush: xml;">
&lt;Group Condition=&quot;$(MyParameter) == '3'&quot;&gt;
    &lt;Check1 /&gt;
    &lt;Check2 /&gt;
&lt;/Group&gt;
</pre>
<p>Now <em>checks </em>from the group presented above will be executed only if <strong>MyParameter </strong>will be set to <strong>3</strong>. Of course <strong>MyParameter </strong>can be set to <strong>3 </strong>from the command line <em>(-p: option)</em>, can be an input parameter or even can be declared in a section somewhere before the <em>group </em>where its value will be evaluated. You can even use environment variable saving its value in parameter and then using condition to evaluate parameter.</p>
<p>Below you can find more extended example of conditions usage. It contains three <em>groups </em>with conditions expecting that value of <strong>MyParameter </strong>will be specified from command line (<em>-p: option</em>). This example has also group with a condition based on an <strong>environment variable</strong> which value is assigned to <strong>UserName </strong>parameter at the top of the script.</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;TestScript xmlns=&quot;http://bytecarrot.com/schemas/ByteCarrot/1.0/TestScript&quot;&gt;
  &lt;Group&gt;
    &lt;Parameters&gt;
        &lt;TestHeader&gt;Test with &quot;My Parameter&quot; == $(MyParameter)&lt;/TestHeader&gt;
        &lt;UserName&gt;$(%USERNAME%)&lt;/UserName&gt;
    &lt;/Parameters&gt;
    &lt;Description&gt;
        &lt;Header&gt;Tests executed conditionally&lt;/Header&gt;
    &lt;/Description&gt;
    &lt;Group Name=&quot;Test&quot; Condition=&quot;$(MyParameter) == '1'&quot;&gt;
        &lt;Description&gt;
            &lt;Header&gt;$(TestHeader)&lt;/Header&gt;
        &lt;/Description&gt;
        &lt;DirectoryExists Path=&quot;C:\Windows&quot; /&gt;
    &lt;/Group&gt;
    &lt;Group Name=&quot;Test&quot; Condition=&quot;$(MyParameter) == '2'&quot;&gt;
        &lt;Description&gt;
            &lt;Header&gt;$(TestHeader)&lt;/Header&gt;
        &lt;/Description&gt;
        &lt;DirectoryExists Path=&quot;C:\Windows&quot; /&gt;
        &lt;DirectoryExists Path=&quot;C:\Program Files&quot; /&gt;
    &lt;/Group&gt;
    &lt;Group Name=&quot;Test&quot; Condition=&quot;$(MyParameter) == '3'&quot;&gt;
        &lt;Description&gt;
            &lt;Header&gt;$(TestHeader)&lt;/Header&gt;
        &lt;/Description&gt;
        &lt;DirectoryExists Path=&quot;C:\Windows&quot; /&gt;
        &lt;DirectoryExists Path=&quot;C:\Program Files&quot; /&gt;
        &lt;DirectoryExists Path=&quot;C:\Users&quot; /&gt;
    &lt;/Group&gt;
  &lt;/Group&gt;
  &lt;Group Condition=&quot;$(UserName) == 'Marcin'&quot;&gt;
    &lt;Group Name=&quot;Test&quot;&gt;
        &lt;DirectoryExists Path=&quot;C:\Users\$(%USERNAME%)&quot; /&gt;
    &lt;/Group&gt;
  &lt;/Group&gt;
&lt;/TestScript&gt;
</pre>
<p>You can execute this script saving it as conditions.xml file (for example) and using following command:</p>
<pre class="brush: php;">
bytecarrot execute -ts:conditions.xml -hr:conditions.html -ohr -p:MyParameter=1
</pre>
<p>Remember to change <strong>MyParameter’s value</strong> in the command in order to check if conditions really work and different parts of test script are executed.</p>
]]></content:encoded>
			<wfw:commentRss>http://bytecarrot.com/index.php/blog/conditions-conditional-execution-bytecarrot/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Real life scenario &#8211; PowerShellCheck and WMI (part 2)</title>
		<link>http://bytecarrot.com/index.php/blog/real-life-scenario-powershellcheck-wmi/</link>
		<comments>http://bytecarrot.com/index.php/blog/real-life-scenario-powershellcheck-wmi/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 23:44:06 +0000</pubDate>
		<dc:creator>Marcin Obel</dc:creator>
				<category><![CDATA[Checks]]></category>
		<category><![CDATA[Features]]></category>
		<category><![CDATA[Example]]></category>
		<category><![CDATA[PowerShellCheck]]></category>
		<category><![CDATA[WmiCheck]]></category>

		<guid isPermaLink="false">http://bytecarrot.com/?p=260</guid>
		<description><![CDATA[This post contains a different way of implementing test script presented in last post. This time instead of RubyCheck I am using PowerShellCheck but the logic remains exactly the same.

&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;TestScript xmlns=&#34;http://bytecarrot.com/schemas/ByteCarrot/1.0/TestScript&#34;&#62;
  &#60;Group&#62;
    &#60;Group Name=&#34;Test&#34;&#62;
      &#60;Parameters&#62;
        &#60;ExpectedCPUSpeed&#62;20000&#60;/ExpectedCPUSpeed&#62;
  [...]]]></description>
			<content:encoded><![CDATA[<p>This post contains a different way of implementing test script presented in last <a title="Real life scenario - RubyCheck and WMI (part 1)" href="/index.php/blog/real-life-scenario-rubycheck-wmi/" target="_blank">post</a>. This time instead of <a title="RubyCheck" href="/index.php/documentation/checks-tasks/rubycheck-check/" target="_blank"><strong>RubyCheck</strong></a> I am using <a title="PowerShellCheck" href="http://bytecarrot.com/index.php/documentation/checks-tasks/powershellcheck-check/" target="_blank"><strong>PowerShellCheck</strong></a> but the logic remains exactly the same.</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;TestScript xmlns=&quot;http://bytecarrot.com/schemas/ByteCarrot/1.0/TestScript&quot;&gt;
  &lt;Group&gt;
    &lt;Group Name=&quot;Test&quot;&gt;
      &lt;Parameters&gt;
        &lt;ExpectedCPUSpeed&gt;20000&lt;/ExpectedCPUSpeed&gt;
      &lt;/Parameters&gt;
      &lt;Description&gt;
        &lt;Header&gt;Tests if CPU has enough speed (at least $(ExpectedCPUSpeed) MHz)&lt;/Header&gt;
      &lt;/Description&gt;
      &lt;PowerShellCheck&gt;
        &lt;Script&gt;
          &lt;![CDATA[
            $Processor = Get-WmiObject Win32_Processor
            $MaxClockSpeed = $Processor[&quot;MaxClockSpeed&quot;]
            $Name = $Processor[&quot;Name&quot;]

            if ($MaxClockSpeed -gt $(ExpectedCPUSpeed)) {
              return success &quot;Processor's speed is OK [CPU: $Name]&quot;
            }
            return failure &quot;Processor is to slow. Its maximum clock speed is $MaxClockSpeed MHz [CPU: $Name]&quot;
          ]]&gt;
        &lt;/Script&gt;
      &lt;/PowerShellCheck&gt;
    &lt;/Group&gt;
  &lt;/Group&gt;
&lt;/TestScript&gt;
</pre>
<p>This example was tested with <a title="PowerShell 2.0" href="http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx" target="_blank"><strong>PowerShell 2.0</strong></a> on Windows 7.</p>
]]></content:encoded>
			<wfw:commentRss>http://bytecarrot.com/index.php/blog/real-life-scenario-powershellcheck-wmi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Real life scenario &#8211; RubyCheck and WMI (part 1)</title>
		<link>http://bytecarrot.com/index.php/blog/real-life-scenario-rubycheck-wmi/</link>
		<comments>http://bytecarrot.com/index.php/blog/real-life-scenario-rubycheck-wmi/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 23:32:28 +0000</pubDate>
		<dc:creator>Marcin Obel</dc:creator>
				<category><![CDATA[Checks]]></category>
		<category><![CDATA[Features]]></category>
		<category><![CDATA[Example]]></category>
		<category><![CDATA[RubyCheck]]></category>
		<category><![CDATA[WmiCheck]]></category>

		<guid isPermaLink="false">http://bytecarrot.com/?p=248</guid>
		<description><![CDATA[Yesterday I received an email from one of a ByteCarrot&#8217;s users. He wanted to write a script to test if hardware on which operating system works meets specified criteria. He wanted to use WMI to retrieve required information and customize messages which are a part of test script results. Of course the simplest way of [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I received an email from one of a <strong>ByteCarrot</strong>&#8217;s users. He wanted to write a script to test if hardware on which operating system works meets specified criteria. He wanted to use WMI to retrieve required information and customize messages which are a part of test script results. Of course the simplest way of creating WMI based check would be usage of <strong><a title="WmiCheck" href="/index.php/documentation/checks-tasks/wmicheck-check/" target="_blank">WmiCheck</a></strong> available out of the box but not in this case because its messages can not be customized. Fortunately <strong>ByteCarrot</strong> was designed to handle also uncommon scenarios so I suggested him use <strong><a title="RubyCheck" href="/index.php/documentation/checks-tasks/rubycheck-check/" target="_blank">RubyCheck</a></strong> instead of <strong>WmiCheck</strong>. In order to show him how to use this particular task in his case I have created a sample presented below.</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;TestScript xmlns=&quot;http://bytecarrot.com/schemas/ByteCarrot/1.0/TestScript&quot;&gt;
  &lt;Group&gt;
    &lt;Group Name=&quot;Test&quot;&gt;
      &lt;Parameters&gt;
        &lt;ExpectedCPUSpeed&gt;20000&lt;/ExpectedCPUSpeed&gt;
      &lt;/Parameters&gt;
      &lt;Description&gt;
        &lt;Header&gt;Tests if CPU has enough speed (at least $(ExpectedCPUSpeed) MHz)&lt;/Header&gt;
      &lt;/Description&gt;
      &lt;RubyCheck&gt;
        &lt;Script&gt;
          &lt;![CDATA[
            load_assembly &quot;System.Management&quot;;
            include System::Management;

            processor = ManagementObject.new(&quot;Win32_Processor.DeviceID='CPU0'&quot;);
            maxClockSpeed = processor[&quot;MaxClockSpeed&quot;].to_i;
            name = processor[&quot;Name&quot;].to_s;

            if (maxClockSpeed &gt; $(ExpectedCPUSpeed))
              return success(&quot;Processor's speed is OK [CPU: #{name}]&quot;);
            end
            return failure(&quot;Processor is to slow. Its maximum clock speed is #{maxClockSpeed} MHz [CPU: #{name}]&quot;);
          ]]&gt;
        &lt;/Script&gt;
      &lt;/RubyCheck&gt;
    &lt;/Group&gt;
  &lt;/Group&gt;
&lt;/TestScript&gt;
</pre>
<p>Because <strong>RubyCheck</strong> is based on <a title="IronRuby website" href="http://ironruby.net/" target="_blank"><strong>IronRuby</strong></a> (implementation of Ruby for .NET platform) there is a possibility to use .NET classes. In this case I am using <strong><a title="ManagementObject" href="http://msdn.microsoft.com/en-us/library/system.management.managementobject.aspx" target="_blank">ManagementObject</a></strong> class providing easy access to WMI objects and theirs properties.</p>
]]></content:encoded>
			<wfw:commentRss>http://bytecarrot.com/index.php/blog/real-life-scenario-rubycheck-wmi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
