Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - RE: Reading XML Patch File for ESX in PowerShell

Reply
 
Old 01-20-2008   #1 (permalink)
RichS


 
 

RE: Reading XML Patch File for ESX in PowerShell

What do you want as output
--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"dm3281" wrote:
Quote:

> Hello -- I have the following XML file that I would like to produce a list
> of all patches for each version of ESX server. I'm having a hard time
> getting this to work at all using a simple foreach.
>
> Can someone please provide a script to read this?
>
> I have attached the file to this post. Thank you!
>
>
>
>
>
> <?xml version="1.0" encoding="utf-8" ?>
> - <!--
> *******************************************************************
> Important !!!!!
> If you have manualy downloaded this file, you have to put it in the patch
> directory.
> for do this manually Save the xml "File/Save AS"
> *******************************************************************
>
>
> -->
> - <ESX>
> <build>69</build>
> - <!--
> *******************************************************************
> ESX 3.50
> *******************************************************************
>
>
> -->
> - <!--
> *******************************************************************
> Full Release
> *******************************************************************
>
>
> -->
> - <ESX350>
> <patch>3.5.0-64607</patch>
> <date>01/03/08</date>
> <classification>Update/Install</classification>
> <summary>Full bundle of ESX 3.5.0-64607</summary>
> <path>http://download3.vmware.com/software/vi</path>
> <md5>43b3617c401e71622c72b10cfcdbc5fe</md5>
> </ESX350>
> - <!--
> *******************************************************************
> ESX 3.02_1
> *******************************************************************
>
>
> -->
> - <!--
> *******************************************************************
> Full Release
> *******************************************************************
>
>
> -->
> - <ESX302>
> <patch>3.0.2-61618</patch>
> <date>10/29/07</date>
> <classification>Update/Install</classification>
> <summary>Full 3.0.2 Update 1 release of VMware ESX Server</summary>
> <path>http://download3.vmware.com/software/vi</path>
> <md5>43b3617c401e71622c72b10cfcdbc5fe</md5>
> </ESX302>
> - <!--
> *******************************************************************
> ESX 3.02
> *******************************************************************
>
>
> -->
> - <!--
> *******************************************************************
> Released 01/02/08
> *******************************************************************
>
>
> -->
> - <ESX302>
> <patch>ESX-1002427</patch>
> <date>01/02/08</date>
> <classification>Critical</classification>
> <summary>Update to the bnx2 Driver</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002427.tgz</path>
> <description />
> <md5>68e43b83d1840b3047de76c0e09e0813</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1002965</patch>
> <date>01/02/08</date>
> <classification>General</classification>
> <summary>megaraid2 Driver Fix for UNISYS Platforms</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002965.tgz</path>
> <description />
> <md5>d44f64af508d2d6a625d353d989d42a3</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1002966</patch>
> <date>01/02/08</date>
> <classification>General</classification>
> <summary>Update to kernel-VMnix</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002966.tgz</path>
> <description />
> <md5>eac7cae80aa34f73eb89b25619582c31</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1002967</patch>
> <date>01/02/08</date>
> <classification>General</classification>
> <summary>Time Zone Rule Updates</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002967.tgz</path>
> <description />
> <md5>bbc64a5b495b071a6acce24d07bbd18d</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1002969</patch>
> <date>01/02/08</date>
> <classification>Security</classification>
> <summary>Security Update to the openssl Package</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002969.tgz</path>
> <description />
> <md5>72fd28a9f9380158db149259fbdcaa3b</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1002970</patch>
> <date>01/02/08</date>
> <classification>Security</classification>
> <summary>Fix for OpenPegasus Management Server</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002970.tgz</path>
> <description />
> <md5>d19115e965d486e72100ce489efea707</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1002971</patch>
> <date>01/02/08</date>
> <classification>Security</classification>
> <summary>Security Update to the Perl Package</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002971.tgz</path>
> <description />
> <md5>337b09d9ae4b1694a045e216b69765e1</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1002974</patch>
> <date>01/02/08</date>
> <classification>General</classification>
> <summary>Fixes for SCSI Reservation Conflicts; Support for EMC
> Invista</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002974.tgz</path>
> <description />
> <md5>caee04b0fcf1aefebc6134a95db8082f</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1002975</patch>
> <date>01/02/08</date>
> <classification>Security</classification>
> <summary>Security Update to the Samba Package</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002975.tgz</path>
> <description />
> <md5>797a7494c2c4eb49629d3f94818df5dd</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1002976</patch>
> <date>01/02/08</date>
> <classification>Security</classification>
> <summary>Security Update to the util-linux Package</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002976.tgz</path>
> <description />
> <md5>0fe833c50c0ecb0ff9340d6674be2e43</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1003175</patch>
> <date>01/02/08</date>
> <classification>General</classification>
> <summary>Update to the esxupdate Utility</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1003175.tgz</path>
> <description />
> <md5>66a606b2a36595b53b9f85eeaff024c8</md5>
> </ESX302>
> - <!--
> *******************************************************************
> Released 11/30/07
> *******************************************************************
>
>
> -->
> - <ESX302>
> <patch>ESX-1002428</patch>
> <date>11/30/07</date>
> <classification>General</classification>
> <summary>QLogic 4Gb HBA Firmware Upgrade</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002428.tgz</path>
> <description />
> <md5>59deaa604be6f9a9356a1d336ca92c5b</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1002430</patch>
> <date>11/30/07</date>
> <classification>Critical</classification>
> <summary>Updates to VMware Tools; Fixes For Installing vmxnet Correctly,
> Compilation Failure With GuestSDK Header Files</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002430.tgz</path>
> <description />
> <md5>0dca6bb53703fe42c709d4849d8194bc</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1002426</patch>
> <date>11/30/07</date>
> <classification>General</classification>
> <summary>Fix for VMware vdf Utility</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002426.tgz</path>
> <description />
> <md5>41f6a6790b448026274b84412cde917c</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1002434</patch>
> <date>11/30/07</date>
> <classification>Security</classification>
> <summary>WebCenter Updates</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002434.tgz</path>
> <description />
> <md5>2f52251f6ace3d50934344ef313539d5</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1002435</patch>
> <date>11/30/07</date>
> <classification>General</classification>
> <summary>VI Client Updates</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002435.tgz</path>
> <description />
> <md5>0b48742e713e8ee86d1e81adfc06984a</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1002431</patch>
> <date>11/30/07</date>
> <classification>General</classification>
> <summary>Updates to VMware-esx-vmx and VMware-esx-vmkernel; Fix For
> Detecting LSI Logic Controller, Support for PCI-X NICs on IBM System
> x3655</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002431.tgz</path>
> <description />
> <md5>e7dfd417ddbc54ecf6f50d21fafcf3c6</md5>
> </ESX302>
> - <!--
> *******************************************************************
> Released 11/15/07
> *******************************************************************
>
>
> -->
> - <ESX302>
> <patch>ESX-1002424</patch>
> <date>11/15/07</date>
> <classification>Critical</classification>
> <summary>Updates to VMware-esx-vmkernel and VMware-esx-vmx; Fixes for
> Issues With Incorrect IP header, Heap Allocation Failure, vmkping and
> ramcheck Failure; Support for OEM Windows SLP</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002424.tgz</path>
> <description />
> <md5>6b666d525062b5ccc8bbb5b09fbcebfb</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1002425</patch>
> <date>11/15/07</date>
> <classification>General</classification>
> <summary>Update to Vmware-hostd-esx</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002425.tgz</path>
> <description />
> <md5>0837108e05a45f07245c65a3059bb26d</md5>
> </ESX302>
> - <ESX302>
> <patch>ESX-1002429</patch>
> <date>11/15/07</date>
> <classification>General</classification>
> <summary>Updates to VMware-esx-drivers-scsi-vmkiscsi and VMware-esx-iscsi;
> Fix for iSCSI path bring- up failure</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1002429.tgz</path>
> <description />
> <md5>b2efbde924fd6b709c2571f12c297ca1</md5>
> </ESX302>
> - <!--
> *******************************************************************
> Released 10/29/07
> *******************************************************************
>
>
> -->
> - <ESX302>
> <patch>ESX-1001902</patch>
> <date>10/29/07</date>
> <classification>General</classification>
> <summary>cciss Driver Upgrade, Support for 16+ Logical Drives</summary>
> <path>http://download3.vmware.com/software/vi/ESX-1001902.tgz</path>
> <description />
> <md5>cf66c9208719bf692281dd90478d349e</md5>
> <includedpatch1>true</includedpatch1>

My System SpecsSystem Spec
Old 01-20-2008   #2 (permalink)
dm3281


 
 

Re: Reading XML Patch File for ESX in PowerShell

Hi, basically the entire file in column format by ESX version...

I.E. -- all patches related to ESX350, then ESX302, then ESX301... all
columns except md5.



"RichS" <RichS@xxxxxx> wrote in message
news:EB8585F5-303E-4C47-8C9F-4D91AB1DC9BD@xxxxxx
Quote:

> What do you want as output
> --
> Richard Siddaway
> Please note that all scripts are supplied "as is" and with no warranty
> Blog: http://richardsiddaway.spaces.live.com/
> PowerShell User Group: http://www.get-psuguk.org.uk
>
>
> "dm3281" wrote:
>
Quote:

>> Hello -- I have the following XML file that I would like to produce a
>> list
>> of all patches for each version of ESX server. I'm having a hard time
>> getting this to work at all using a simple foreach.
>>
>> Can someone please provide a script to read this?
>>
>> I have attached the file to this post. Thank you!
>>
>>
>>
>>
>>
>> <?xml version="1.0" encoding="utf-8" ?>
>> - <!--
>> *******************************************************************
>> Important !!!!!
>> If you have manualy downloaded this file, you have to put it in the patch
>> directory.
>> for do this manually Save the xml "File/Save AS"
>> *******************************************************************
>>
>>
>> -->
>> - <ESX>
>> <build>69</build>
>> - <!--
>> *******************************************************************
>> ESX 3.50
>> *******************************************************************
>>
>>
>> -->
>> - <!--
>> *******************************************************************
>> Full Release
>> *******************************************************************
>>
>>
>> -->
>> - <ESX350>
>> <patch>3.5.0-64607</patch>
>> <date>01/03/08</date>
>> <classification>Update/Install</classification>
>> <summary>Full bundle of ESX 3.5.0-64607</summary>
>> <path>http://download3.vmware.com/software/vi</path>
>> <md5>43b3617c401e71622c72b10cfcdbc5fe</md5>
>> </ESX350>
>> - <!--
>> *******************************************************************
>> ESX 3.02_1
>> *******************************************************************
>>
>>
>> -->
>> - <!--
>> *******************************************************************
>> Full Release
>> *******************************************************************
>>
>>
>> -->
>> - <ESX302>
>> <patch>3.0.2-61618</patch>
>> <date>10/29/07</date>
>> <classification>Update/Install</classification>
>> <summary>Full 3.0.2 Update 1 release of VMware ESX Server</summary>
>> <path>http://download3.vmware.com/software/vi</path>
>> <md5>43b3617c401e71622c72b10cfcdbc5fe</md5>
>> </ESX302>
>> - <!--
>> *******************************************************************
>> ESX 3.02
>> *******************************************************************
>>
>>
>> -->
>> - <!--
>> *******************************************************************
>> Released 01/02/08
>> *******************************************************************
>>
>>
>> -->
>> - <ESX302>
>> <patch>ESX-1002427</patch>
>> <date>01/02/08</date>
>> <classification>Critical</classification>
>> <summary>Update to the bnx2 Driver</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002427.tgz</path>
>> <description />
>> <md5>68e43b83d1840b3047de76c0e09e0813</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1002965</patch>
>> <date>01/02/08</date>
>> <classification>General</classification>
>> <summary>megaraid2 Driver Fix for UNISYS Platforms</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002965.tgz</path>
>> <description />
>> <md5>d44f64af508d2d6a625d353d989d42a3</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1002966</patch>
>> <date>01/02/08</date>
>> <classification>General</classification>
>> <summary>Update to kernel-VMnix</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002966.tgz</path>
>> <description />
>> <md5>eac7cae80aa34f73eb89b25619582c31</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1002967</patch>
>> <date>01/02/08</date>
>> <classification>General</classification>
>> <summary>Time Zone Rule Updates</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002967.tgz</path>
>> <description />
>> <md5>bbc64a5b495b071a6acce24d07bbd18d</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1002969</patch>
>> <date>01/02/08</date>
>> <classification>Security</classification>
>> <summary>Security Update to the openssl Package</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002969.tgz</path>
>> <description />
>> <md5>72fd28a9f9380158db149259fbdcaa3b</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1002970</patch>
>> <date>01/02/08</date>
>> <classification>Security</classification>
>> <summary>Fix for OpenPegasus Management Server</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002970.tgz</path>
>> <description />
>> <md5>d19115e965d486e72100ce489efea707</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1002971</patch>
>> <date>01/02/08</date>
>> <classification>Security</classification>
>> <summary>Security Update to the Perl Package</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002971.tgz</path>
>> <description />
>> <md5>337b09d9ae4b1694a045e216b69765e1</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1002974</patch>
>> <date>01/02/08</date>
>> <classification>General</classification>
>> <summary>Fixes for SCSI Reservation Conflicts; Support for EMC
>> Invista</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002974.tgz</path>
>> <description />
>> <md5>caee04b0fcf1aefebc6134a95db8082f</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1002975</patch>
>> <date>01/02/08</date>
>> <classification>Security</classification>
>> <summary>Security Update to the Samba Package</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002975.tgz</path>
>> <description />
>> <md5>797a7494c2c4eb49629d3f94818df5dd</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1002976</patch>
>> <date>01/02/08</date>
>> <classification>Security</classification>
>> <summary>Security Update to the util-linux Package</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002976.tgz</path>
>> <description />
>> <md5>0fe833c50c0ecb0ff9340d6674be2e43</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1003175</patch>
>> <date>01/02/08</date>
>> <classification>General</classification>
>> <summary>Update to the esxupdate Utility</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1003175.tgz</path>
>> <description />
>> <md5>66a606b2a36595b53b9f85eeaff024c8</md5>
>> </ESX302>
>> - <!--
>> *******************************************************************
>> Released 11/30/07
>> *******************************************************************
>>
>>
>> -->
>> - <ESX302>
>> <patch>ESX-1002428</patch>
>> <date>11/30/07</date>
>> <classification>General</classification>
>> <summary>QLogic 4Gb HBA Firmware Upgrade</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002428.tgz</path>
>> <description />
>> <md5>59deaa604be6f9a9356a1d336ca92c5b</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1002430</patch>
>> <date>11/30/07</date>
>> <classification>Critical</classification>
>> <summary>Updates to VMware Tools; Fixes For Installing vmxnet
>> Correctly,
>> Compilation Failure With GuestSDK Header Files</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002430.tgz</path>
>> <description />
>> <md5>0dca6bb53703fe42c709d4849d8194bc</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1002426</patch>
>> <date>11/30/07</date>
>> <classification>General</classification>
>> <summary>Fix for VMware vdf Utility</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002426.tgz</path>
>> <description />
>> <md5>41f6a6790b448026274b84412cde917c</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1002434</patch>
>> <date>11/30/07</date>
>> <classification>Security</classification>
>> <summary>WebCenter Updates</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002434.tgz</path>
>> <description />
>> <md5>2f52251f6ace3d50934344ef313539d5</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1002435</patch>
>> <date>11/30/07</date>
>> <classification>General</classification>
>> <summary>VI Client Updates</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002435.tgz</path>
>> <description />
>> <md5>0b48742e713e8ee86d1e81adfc06984a</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1002431</patch>
>> <date>11/30/07</date>
>> <classification>General</classification>
>> <summary>Updates to VMware-esx-vmx and VMware-esx-vmkernel; Fix For
>> Detecting LSI Logic Controller, Support for PCI-X NICs on IBM System
>> x3655</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002431.tgz</path>
>> <description />
>> <md5>e7dfd417ddbc54ecf6f50d21fafcf3c6</md5>
>> </ESX302>
>> - <!--
>> *******************************************************************
>> Released 11/15/07
>> *******************************************************************
>>
>>
>> -->
>> - <ESX302>
>> <patch>ESX-1002424</patch>
>> <date>11/15/07</date>
>> <classification>Critical</classification>
>> <summary>Updates to VMware-esx-vmkernel and VMware-esx-vmx; Fixes for
>> Issues With Incorrect IP header, Heap Allocation Failure, vmkping and
>> ramcheck Failure; Support for OEM Windows SLP</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002424.tgz</path>
>> <description />
>> <md5>6b666d525062b5ccc8bbb5b09fbcebfb</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1002425</patch>
>> <date>11/15/07</date>
>> <classification>General</classification>
>> <summary>Update to Vmware-hostd-esx</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002425.tgz</path>
>> <description />
>> <md5>0837108e05a45f07245c65a3059bb26d</md5>
>> </ESX302>
>> - <ESX302>
>> <patch>ESX-1002429</patch>
>> <date>11/15/07</date>
>> <classification>General</classification>
>> <summary>Updates to VMware-esx-drivers-scsi-vmkiscsi and
>> VMware-esx-iscsi;
>> Fix for iSCSI path bring- up failure</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1002429.tgz</path>
>> <description />
>> <md5>b2efbde924fd6b709c2571f12c297ca1</md5>
>> </ESX302>
>> - <!--
>> *******************************************************************
>> Released 10/29/07
>> *******************************************************************
>>
>>
>> -->
>> - <ESX302>
>> <patch>ESX-1001902</patch>
>> <date>10/29/07</date>
>> <classification>General</classification>
>> <summary>cciss Driver Upgrade, Support for 16+ Logical Drives</summary>
>> <path>http://download3.vmware.com/software/vi/ESX-1001902.tgz</path>
>> <description />
>> <md5>cf66c9208719bf692281dd90478d349e</md5>
>> <includedpatch1>true</includedpatch1>
My System SpecsSystem Spec
Old 01-20-2008   #3 (permalink)
dm3281


 
 

Re: Reading XML Patch File for ESX in PowerShell

This is what I came up with... but I don't like how I have to know to use
"esx301" or "esx302" for the node.

[xml] $patches = get-content c:\temp\esxupdate.xml
foreach ($p in $patches.esx) {
foreach ($i in $p.esx302) {
$match = new-object PsObject
$match | add-member NoteProperty Patch $i.patch
$match | add-member NoteProperty Date $i.date
$match | add-member NoteProperty Classification $i.classification
$match | add-member NoteProperty Summary $i.summary
write-host $match.Patch, $match.date, $match.Classification,
$match.Summary
# $match | format-table -hideTableHeaders -autosize
}
}
foreach ($p in $patches.esx) {
foreach ($i in $p.esx301) {
$match = new-object PsObject
$match | add-member NoteProperty Patch $i.patch
$match | add-member NoteProperty Date $i.date
$match | add-member NoteProperty Classification $i.classification
$match | add-member NoteProperty Summary $i.summary
write-host $match.Patch, $match.date, $match.Classification,
$match.Summary
# $match | format-table -hideTableHeaders -autosize
}
}


Also, I'm not sure if using add-member is necessary for displaying a
columnar output, I tried write-host $i.patch + " " + $i.date etc, but got
conversion mismatch errors, etc???






"dm3281" <dm3281@xxxxxx> wrote in message
news:F1E00A91-808D-475F-8355-76035E7F9AE7@xxxxxx
Quote:

> Hi, basically the entire file in column format by ESX version...
>
> I.E. -- all patches related to ESX350, then ESX302, then ESX301... all
> columns except md5.
>
>
>
> "RichS" <RichS@xxxxxx> wrote in message
> news:EB8585F5-303E-4C47-8C9F-4D91AB1DC9BD@xxxxxx
Quote:

>> What do you want as output
>> --
>> Richard Siddaway
>> Please note that all scripts are supplied "as is" and with no warranty
>> Blog: http://richardsiddaway.spaces.live.com/
>> PowerShell User Group: http://www.get-psuguk.org.uk
>>
>>
>> "dm3281" wrote:
>>
Quote:

>>> Hello -- I have the following XML file that I would like to produce a
>>> list
>>> of all patches for each version of ESX server. I'm having a hard time
>>> getting this to work at all using a simple foreach.
>>>
>>> Can someone please provide a script to read this?
>>>
>>> I have attached the file to this post. Thank you!
>>>
>>>
>>>
>>>
>>>
>>> <?xml version="1.0" encoding="utf-8" ?>
>>> - <!--
>>> *******************************************************************
>>> Important !!!!!
>>> If you have manualy downloaded this file, you have to put it in the
>>> patch
>>> directory.
>>> for do this manually Save the xml "File/Save AS"
>>> *******************************************************************
>>>
>>>
>>> -->
>>> - <ESX>
>>> <build>69</build>
>>> - <!--
>>> *******************************************************************
>>> ESX 3.50
>>> *******************************************************************
>>>
>>>
>>> -->
>>> - <!--
>>> *******************************************************************
>>> Full Release
>>> *******************************************************************
>>>
>>>
>>> -->
>>> - <ESX350>
>>> <patch>3.5.0-64607</patch>
>>> <date>01/03/08</date>
>>> <classification>Update/Install</classification>
>>> <summary>Full bundle of ESX 3.5.0-64607</summary>
>>> <path>http://download3.vmware.com/software/vi</path>
>>> <md5>43b3617c401e71622c72b10cfcdbc5fe</md5>
>>> </ESX350>
>>> - <!--
>>> *******************************************************************
>>> ESX 3.02_1
>>> *******************************************************************
>>>
>>>
>>> -->
>>> - <!--
>>> *******************************************************************
>>> Full Release
>>> *******************************************************************
>>>
>>>
>>> -->
>>> - <ESX302>
>>> <patch>3.0.2-61618</patch>
>>> <date>10/29/07</date>
>>> <classification>Update/Install</classification>
>>> <summary>Full 3.0.2 Update 1 release of VMware ESX Server</summary>
>>> <path>http://download3.vmware.com/software/vi</path>
>>> <md5>43b3617c401e71622c72b10cfcdbc5fe</md5>
>>> </ESX302>
>>> - <!--
>>> *******************************************************************
>>> ESX 3.02
>>> *******************************************************************
>>>
>>>
>>> -->
>>> - <!--
>>> *******************************************************************
>>> Released 01/02/08
>>> *******************************************************************
>>>
>>>
>>> -->
>>> - <ESX302>
>>> <patch>ESX-1002427</patch>
>>> <date>01/02/08</date>
>>> <classification>Critical</classification>
>>> <summary>Update to the bnx2 Driver</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002427.tgz</path>
>>> <description />
>>> <md5>68e43b83d1840b3047de76c0e09e0813</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1002965</patch>
>>> <date>01/02/08</date>
>>> <classification>General</classification>
>>> <summary>megaraid2 Driver Fix for UNISYS Platforms</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002965.tgz</path>
>>> <description />
>>> <md5>d44f64af508d2d6a625d353d989d42a3</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1002966</patch>
>>> <date>01/02/08</date>
>>> <classification>General</classification>
>>> <summary>Update to kernel-VMnix</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002966.tgz</path>
>>> <description />
>>> <md5>eac7cae80aa34f73eb89b25619582c31</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1002967</patch>
>>> <date>01/02/08</date>
>>> <classification>General</classification>
>>> <summary>Time Zone Rule Updates</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002967.tgz</path>
>>> <description />
>>> <md5>bbc64a5b495b071a6acce24d07bbd18d</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1002969</patch>
>>> <date>01/02/08</date>
>>> <classification>Security</classification>
>>> <summary>Security Update to the openssl Package</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002969.tgz</path>
>>> <description />
>>> <md5>72fd28a9f9380158db149259fbdcaa3b</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1002970</patch>
>>> <date>01/02/08</date>
>>> <classification>Security</classification>
>>> <summary>Fix for OpenPegasus Management Server</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002970.tgz</path>
>>> <description />
>>> <md5>d19115e965d486e72100ce489efea707</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1002971</patch>
>>> <date>01/02/08</date>
>>> <classification>Security</classification>
>>> <summary>Security Update to the Perl Package</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002971.tgz</path>
>>> <description />
>>> <md5>337b09d9ae4b1694a045e216b69765e1</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1002974</patch>
>>> <date>01/02/08</date>
>>> <classification>General</classification>
>>> <summary>Fixes for SCSI Reservation Conflicts; Support for EMC
>>> Invista</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002974.tgz</path>
>>> <description />
>>> <md5>caee04b0fcf1aefebc6134a95db8082f</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1002975</patch>
>>> <date>01/02/08</date>
>>> <classification>Security</classification>
>>> <summary>Security Update to the Samba Package</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002975.tgz</path>
>>> <description />
>>> <md5>797a7494c2c4eb49629d3f94818df5dd</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1002976</patch>
>>> <date>01/02/08</date>
>>> <classification>Security</classification>
>>> <summary>Security Update to the util-linux Package</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002976.tgz</path>
>>> <description />
>>> <md5>0fe833c50c0ecb0ff9340d6674be2e43</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1003175</patch>
>>> <date>01/02/08</date>
>>> <classification>General</classification>
>>> <summary>Update to the esxupdate Utility</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1003175.tgz</path>
>>> <description />
>>> <md5>66a606b2a36595b53b9f85eeaff024c8</md5>
>>> </ESX302>
>>> - <!--
>>> *******************************************************************
>>> Released 11/30/07
>>> *******************************************************************
>>>
>>>
>>> -->
>>> - <ESX302>
>>> <patch>ESX-1002428</patch>
>>> <date>11/30/07</date>
>>> <classification>General</classification>
>>> <summary>QLogic 4Gb HBA Firmware Upgrade</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002428.tgz</path>
>>> <description />
>>> <md5>59deaa604be6f9a9356a1d336ca92c5b</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1002430</patch>
>>> <date>11/30/07</date>
>>> <classification>Critical</classification>
>>> <summary>Updates to VMware Tools; Fixes For Installing vmxnet
>>> Correctly,
>>> Compilation Failure With GuestSDK Header Files</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002430.tgz</path>
>>> <description />
>>> <md5>0dca6bb53703fe42c709d4849d8194bc</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1002426</patch>
>>> <date>11/30/07</date>
>>> <classification>General</classification>
>>> <summary>Fix for VMware vdf Utility</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002426.tgz</path>
>>> <description />
>>> <md5>41f6a6790b448026274b84412cde917c</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1002434</patch>
>>> <date>11/30/07</date>
>>> <classification>Security</classification>
>>> <summary>WebCenter Updates</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002434.tgz</path>
>>> <description />
>>> <md5>2f52251f6ace3d50934344ef313539d5</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1002435</patch>
>>> <date>11/30/07</date>
>>> <classification>General</classification>
>>> <summary>VI Client Updates</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002435.tgz</path>
>>> <description />
>>> <md5>0b48742e713e8ee86d1e81adfc06984a</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1002431</patch>
>>> <date>11/30/07</date>
>>> <classification>General</classification>
>>> <summary>Updates to VMware-esx-vmx and VMware-esx-vmkernel; Fix For
>>> Detecting LSI Logic Controller, Support for PCI-X NICs on IBM System
>>> x3655</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002431.tgz</path>
>>> <description />
>>> <md5>e7dfd417ddbc54ecf6f50d21fafcf3c6</md5>
>>> </ESX302>
>>> - <!--
>>> *******************************************************************
>>> Released 11/15/07
>>> *******************************************************************
>>>
>>>
>>> -->
>>> - <ESX302>
>>> <patch>ESX-1002424</patch>
>>> <date>11/15/07</date>
>>> <classification>Critical</classification>
>>> <summary>Updates to VMware-esx-vmkernel and VMware-esx-vmx; Fixes for
>>> Issues With Incorrect IP header, Heap Allocation Failure, vmkping and
>>> ramcheck Failure; Support for OEM Windows SLP</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002424.tgz</path>
>>> <description />
>>> <md5>6b666d525062b5ccc8bbb5b09fbcebfb</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1002425</patch>
>>> <date>11/15/07</date>
>>> <classification>General</classification>
>>> <summary>Update to Vmware-hostd-esx</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002425.tgz</path>
>>> <description />
>>> <md5>0837108e05a45f07245c65a3059bb26d</md5>
>>> </ESX302>
>>> - <ESX302>
>>> <patch>ESX-1002429</patch>
>>> <date>11/15/07</date>
>>> <classification>General</classification>
>>> <summary>Updates to VMware-esx-drivers-scsi-vmkiscsi and
>>> VMware-esx-iscsi;
>>> Fix for iSCSI path bring- up failure</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1002429.tgz</path>
>>> <description />
>>> <md5>b2efbde924fd6b709c2571f12c297ca1</md5>
>>> </ESX302>
>>> - <!--
>>> *******************************************************************
>>> Released 10/29/07
>>> *******************************************************************
>>>
>>>
>>> -->
>>> - <ESX302>
>>> <patch>ESX-1001902</patch>
>>> <date>10/29/07</date>
>>> <classification>General</classification>
>>> <summary>cciss Driver Upgrade, Support for 16+ Logical
>>> Drives</summary>
>>> <path>http://download3.vmware.com/software/vi/ESX-1001902.tgz</path>
>>> <description />
>>> <md5>cf66c9208719bf692281dd90478d349e</md5>
>>> <includedpatch1>true</includedpatch1>
>
My System SpecsSystem Spec
Old 01-20-2008   #4 (permalink)
Kiron


 
 

Re: Reading XML Patch File for ESX in PowerShell

Try this:

$esxupdate.esx | gm esx* | % {$esxupdate.esx.$($_.name)} |
select name, patch, date, classification, summary | ft -a -w

--
Kiron
My System SpecsSystem Spec
Old 01-21-2008   #5 (permalink)
dm3281


 
 

Re: Reading XML Patch File for ESX in PowerShell

Is there anyway I can get it not to display the name column?



[xml] $patches = get-content c:\temp\esxupdate.xml
$patches.esx | gm esx* | % {$patches.esx.$($_.name)} | select name, patch, date, classification, summary | ft -a -w




"Kiron" <Kiron@xxxxxx> wrote in message news:70D906BB-70DF-4FB7-9FC3-85E4F420ADF5@xxxxxx
Try this:

$esxupdate.esx | gm esx* | % {$esxupdate.esx.$($_.name)} |
select name, patch, date, classification, summary | ft -a -w

--
Kiron
My System SpecsSystem Spec
Old 01-21-2008   #6 (permalink)
Kiron


 
 

Re: Reading XML Patch File for ESX in PowerShell

Sure, remove the property from Select:

[xml] $patches = get-content c:\temp\esxupdate.xml
$patches.esx | gm esx* | % {$patches.esx.$($_.name)} | select patch, date, classification, summary | ft -a -w

--
Kiron
My System SpecsSystem Spec
Old 01-21-2008   #7 (permalink)
dm3281


 
 

Re: Reading XML Patch File for ESX in PowerShell

Thanks, for some reason I didn't catch that.

Do you know how I can have it sort by ESX301, ESX302, etc, and also date?




"Kiron" <Kiron@xxxxxx> wrote in message
news:%23RhUgXJXIHA.3556@xxxxxx
Quote:

> Sure, remove the property from Select:
>
> [xml] $patches = get-content c:\temp\esxupdate.xml
> $patches.esx | gm esx* | % {$patches.esx.$($_.name)} | select patch, date,
> classification, summary | ft -a -w
>
> --
> Kiron
My System SpecsSystem Spec
Old 01-21-2008   #8 (permalink)
Kiron


 
 

Re: Reading XML Patch File for ESX in PowerShell

Sort before Select. Note the use of a calculated property to sort on Date:

$patches.esx | gm esx* | % {$patches.esx.$($_.name)} | sort name, @{expression = {[datetime]$_.date}} | select patch, date, classification, summary | ft -a -w

# this works also:
$patches.esx | gm esx* | % {$patches.esx.$($_.name)} | sort name, {[datetime]$_.date} | select patch, date, classification, summary | ft -a -w

--
Kiron
My System SpecsSystem Spec
Old 02-01-2008   #9 (permalink)
dm3281


 
 

Re: Reading XML Patch File for ESX in PowerShell

That worked. Thank you!



"Kiron" <Kiron@xxxxxx> wrote in message
news:u3ZOJnJXIHA.1168@xxxxxx
Quote:

> Sort before Select. Note the use of a calculated property to sort on Date:
>
> $patches.esx | gm esx* | % {$patches.esx.$($_.name)} | sort name,
> @{expression = {[datetime]$_.date}} | select patch, date, classification,
> summary | ft -a -w
>
> # this works also:
> $patches.esx | gm esx* | % {$patches.esx.$($_.name)} | sort name,
> {[datetime]$_.date} | select patch, date, classification, summary |
> ft -a -w
>
> --
> Kiron
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Reading x86 or x64 registry from Powershell - Help with my script! PowerShell
Find hidden file, Reading from txt file VB Script
Reading text files using powershell PowerShell
PowerShell ESX Patch Script PowerShell
Reading event log files - PowerShell and LogParser 2.2 PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46