<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: PowerShell Scripting with WMI Part 3</title>
	<atom:link href="http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.powershellpro.com</link>
	<description>Sharing the Experience</description>
	<lastBuildDate>Mon, 06 Sep 2010 23:05:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Huijari</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/comment-page-1/#comment-500</link>
		<dc:creator>Huijari</dc:creator>
		<pubDate>Tue, 06 Jul 2010 11:23:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/#comment-500</guid>
		<description>I think that for most applications using write-output in the script and piping the script to Tee-Object (ie. the original bios script with write-hosts replaced by write-outputs and then .\bios.ps1 &#124; Tee-Object my_output.txt) would suffice in getting the output both to screen and to a file. I&#039;m not sure whether the Tee-Object commandlet was available at the time of the writing of this tutorial, but at least now it is :) Coming from unix, &quot;tee&quot; was the first thing that popped into my mind while reading this and sure enough there was a similar commandlet available. See Get-Help Tee-Object. Cheers!</description>
		<content:encoded><![CDATA[<p>I think that for most applications using write-output in the script and piping the script to Tee-Object (ie. the original bios script with write-hosts replaced by write-outputs and then .\bios.ps1 | Tee-Object my_output.txt) would suffice in getting the output both to screen and to a file. I&#8217;m not sure whether the Tee-Object commandlet was available at the time of the writing of this tutorial, but at least now it is <img src='http://www.powershellpro.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Coming from unix, &#8220;tee&#8221; was the first thing that popped into my mind while reading this and sure enough there was a similar commandlet available. See Get-Help Tee-Object. Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Doe</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/comment-page-1/#comment-475</link>
		<dc:creator>John Doe</dc:creator>
		<pubDate>Fri, 14 May 2010 15:24:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/#comment-475</guid>
		<description>Get-WmiObject “win32_BIOS” &#124; ConvertTo-HTML -Property Name,Description,Status,Version `
-title “BIOS INFO” &#124; Format-Table -Auto &#124; Out-File “C:MyScriptsBIOSRptWeb.html”

That part of the Tut is not quite right. Or let&#039;s say the format-table is unnecessary because convertto-html always chooses table format. And, try to put in &quot;format-list&quot;, it won&#039;t work. To output the HTML as list you have to write just that:
ConvertTo-Html -As List
apart from that, great tut, helped me a lot. Thanx</description>
		<content:encoded><![CDATA[<p>Get-WmiObject “win32_BIOS” | ConvertTo-HTML -Property Name,Description,Status,Version `<br />
-title “BIOS INFO” | Format-Table -Auto | Out-File “C:MyScriptsBIOSRptWeb.html”</p>
<p>That part of the Tut is not quite right. Or let&#8217;s say the format-table is unnecessary because convertto-html always chooses table format. And, try to put in &#8220;format-list&#8221;, it won&#8217;t work. To output the HTML as list you have to write just that:<br />
ConvertTo-Html -As List<br />
apart from that, great tut, helped me a lot. Thanx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/comment-page-1/#comment-420</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Wed, 21 Oct 2009 19:27:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/#comment-420</guid>
		<description>Thanks so much for the tutorials, these are the best I&#039;ve found.  

With the knowledge learned from this I&#039;m trying to create a script that loads a text file of computers and queries for HD setttings and will output to a one page Excel document.  I&#039;m basically doing a nested loop and calling a function:

Function DiskInfo{
$colItems = Get-wmiObject -class “Win32_LogicalDisk” -namespace “root\CIMV2&quot;`
-computername $strComputer &#124;
% {
$introw += 1
$Sheet.Cells.Item($intRow,1) = $_.SystemName
$Sheet.Cells.Item($intRow,2) = $_.DeviceID
$Sheet.Cells.Item($intRow,3) = $_.Description
$Sheet.Cells.Item($intRow,4) = $_.FileSystem
$Sheet.Cells.Item($intRow,5) = $_.Size / 1GB
$Sheet.Cells.Item($intRow,6) = $_.FreeSpace / 1GB
}
$introw += 1
}


$arrComputers = get-Content -Path “C:\Computers.txt”
foreach ($strComputer in $arrComputers){Diskinfo}

Everything seems to work except &quot;$intRow = $intRow + 1&quot; only increments within the ForEach loop.  So every new computer overwrites the previous computer&#039;s output.

How do I pass the correct $inRow variable outside this loop?

Thanks</description>
		<content:encoded><![CDATA[<p>Thanks so much for the tutorials, these are the best I&#8217;ve found.  </p>
<p>With the knowledge learned from this I&#8217;m trying to create a script that loads a text file of computers and queries for HD setttings and will output to a one page Excel document.  I&#8217;m basically doing a nested loop and calling a function:</p>
<p>Function DiskInfo{<br />
$colItems = Get-wmiObject -class “Win32_LogicalDisk” -namespace “root\CIMV2&#8243;`<br />
-computername $strComputer |<br />
% {<br />
$introw += 1<br />
$Sheet.Cells.Item($intRow,1) = $_.SystemName<br />
$Sheet.Cells.Item($intRow,2) = $_.DeviceID<br />
$Sheet.Cells.Item($intRow,3) = $_.Description<br />
$Sheet.Cells.Item($intRow,4) = $_.FileSystem<br />
$Sheet.Cells.Item($intRow,5) = $_.Size / 1GB<br />
$Sheet.Cells.Item($intRow,6) = $_.FreeSpace / 1GB<br />
}<br />
$introw += 1<br />
}</p>
<p>$arrComputers = get-Content -Path “C:\Computers.txt”<br />
foreach ($strComputer in $arrComputers){Diskinfo}</p>
<p>Everything seems to work except &#8220;$intRow = $intRow + 1&#8243; only increments within the ForEach loop.  So every new computer overwrites the previous computer&#8217;s output.</p>
<p>How do I pass the correct $inRow variable outside this loop?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NevJam</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/comment-page-1/#comment-294</link>
		<dc:creator>NevJam</dc:creator>
		<pubDate>Wed, 11 Mar 2009 14:17:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/#comment-294</guid>
		<description>Thanks to you I now have script I run against my remote servers that gets wmi info for all sort like h/w, s/w, ip etc and dumps it in a .xls file.

Is there anyway you know of including information taken from the registry in this example?

Our OS where I work is patched using an update package. Each package has a version. This version information is stored within HKLM\SOFTWARE\Build and a key called Version stores the version info.

Is there anyway of running a wmi type script against remote registries and storing that info in a .xls? If not wmi perhaps there is another way of gleening info from remote registries using powershell?

Thanks.</description>
		<content:encoded><![CDATA[<p>Thanks to you I now have script I run against my remote servers that gets wmi info for all sort like h/w, s/w, ip etc and dumps it in a .xls file.</p>
<p>Is there anyway you know of including information taken from the registry in this example?</p>
<p>Our OS where I work is patched using an update package. Each package has a version. This version information is stored within HKLM\SOFTWARE\Build and a key called Version stores the version info.</p>
<p>Is there anyway of running a wmi type script against remote registries and storing that info in a .xls? If not wmi perhaps there is another way of gleening info from remote registries using powershell?</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NevJam</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/comment-page-1/#comment-274</link>
		<dc:creator>NevJam</dc:creator>
		<pubDate>Fri, 09 Jan 2009 10:58:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/#comment-274</guid>
		<description>Excellent Article. Two questions:
1. How do I use your output to CSV example without launching excel? I want to pump wmi data into a closed csv file which I can then import into an sql table.

2. I have tried the select-object example which works fine for locally, however if I try to run it on multiple servers using my dodgy scripting skills, my csv output is overwritten by the next server in the list. I can&#039;t seem to append the data:

$arrservers = get-Content -Path &quot;C:\ps\testServers.txt&quot;
foreach ($server in $arrservers){
Get-WmiObject Win32_ComputerSystem -computername $server &#124; Select-Object Name,TotalPhysicalMemory &#124; Export-CSV Meminfo.csv
}

Any help appreciated.
Thanks.</description>
		<content:encoded><![CDATA[<p>Excellent Article. Two questions:<br />
1. How do I use your output to CSV example without launching excel? I want to pump wmi data into a closed csv file which I can then import into an sql table.</p>
<p>2. I have tried the select-object example which works fine for locally, however if I try to run it on multiple servers using my dodgy scripting skills, my csv output is overwritten by the next server in the list. I can&#8217;t seem to append the data:</p>
<p>$arrservers = get-Content -Path &#8220;C:\ps\testServers.txt&#8221;<br />
foreach ($server in $arrservers){<br />
Get-WmiObject Win32_ComputerSystem -computername $server | Select-Object Name,TotalPhysicalMemory | Export-CSV Meminfo.csv<br />
}</p>
<p>Any help appreciated.<br />
Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlos</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/comment-page-1/#comment-273</link>
		<dc:creator>Carlos</dc:creator>
		<pubDate>Wed, 07 Jan 2009 22:11:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/#comment-273</guid>
		<description>Very enlightening, I see some of the code snipets have typing errors but was able to correct them after first run. All in all, a great PowerShell primer.

Carlos.</description>
		<content:encoded><![CDATA[<p>Very enlightening, I see some of the code snipets have typing errors but was able to correct them after first run. All in all, a great PowerShell primer.</p>
<p>Carlos.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse Hamrick</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/comment-page-1/#comment-244</link>
		<dc:creator>Jesse Hamrick</dc:creator>
		<pubDate>Fri, 07 Nov 2008 02:01:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/#comment-244</guid>
		<description>As far as I know PS 2.0 Beta is still available on the MS site...</description>
		<content:encoded><![CDATA[<p>As far as I know PS 2.0 Beta is still available on the MS site&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MandM</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/comment-page-1/#comment-243</link>
		<dc:creator>MandM</dc:creator>
		<pubDate>Wed, 05 Nov 2008 06:13:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/#comment-243</guid>
		<description>Very useful information to me (surely for other people as well who are PS begineers like me!). Marvellous job!

Any idea how to run PS script on a remote computer? I heard &quot;remoting&quot; is supported in PS v2.0...any idea when PS 2.0 will be released?</description>
		<content:encoded><![CDATA[<p>Very useful information to me (surely for other people as well who are PS begineers like me!). Marvellous job!</p>
<p>Any idea how to run PS script on a remote computer? I heard &#8220;remoting&#8221; is supported in PS v2.0&#8230;any idea when PS 2.0 will be released?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GaryM</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/comment-page-1/#comment-227</link>
		<dc:creator>GaryM</dc:creator>
		<pubDate>Wed, 01 Oct 2008 14:29:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/#comment-227</guid>
		<description>Dave, to be honest all I did was install the US regional local and set it as default on my machine.  Sorry re the slow response, not been on this site for a while.</description>
		<content:encoded><![CDATA[<p>Dave, to be honest all I did was install the US regional local and set it as default on my machine.  Sorry re the slow response, not been on this site for a while.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ashton</title>
		<link>http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/comment-page-1/#comment-212</link>
		<dc:creator>Dave Ashton</dc:creator>
		<pubDate>Tue, 16 Sep 2008 14:02:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/powershell-tutorial-introduction/wmi-part3/#comment-212</guid>
		<description>GaryM - for a newbie, can you explain how you do that in Powershell? I dont know how to translate the examples in the MS article, to a powershell script.</description>
		<content:encoded><![CDATA[<p>GaryM &#8211; for a newbie, can you explain how you do that in Powershell? I dont know how to translate the examples in the MS article, to a powershell script.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
