<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for ICT-Freak.nl</title>
	<atom:link href="http://ict-freak.nl/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://ict-freak.nl</link>
	<description>VMware, Linux, Scripting...</description>
	<lastBuildDate>Thu, 02 Feb 2012 13:00:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>Comment on PowerCLI: Move-Template by vanmemet</title>
		<link>http://ict-freak.nl/2010/01/21/powercli-move-template/comment-page-1/#comment-18193</link>
		<dc:creator><![CDATA[vanmemet]]></dc:creator>
		<pubDate>Thu, 02 Feb 2012 13:00:30 +0000</pubDate>
		<guid isPermaLink="false">http://ictfreak.wordpress.com/2010/01/21/powercli-move-template/#comment-18193</guid>
		<description><![CDATA[thanks. this save my time alot when especially run in vcenter.]]></description>
		<content:encoded><![CDATA[<p>thanks. this save my time alot when especially run in vcenter.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PowerCLI: Move-Template by sean</title>
		<link>http://ict-freak.nl/2010/01/21/powercli-move-template/comment-page-1/#comment-18182</link>
		<dc:creator><![CDATA[sean]]></dc:creator>
		<pubDate>Wed, 01 Feb 2012 06:55:57 +0000</pubDate>
		<guid isPermaLink="false">http://ictfreak.wordpress.com/2010/01/21/powercli-move-template/#comment-18182</guid>
		<description><![CDATA[------=== SORRY, the following should be the correct output ===------

[vSphere PowerCLI] C:\tools &gt; .\Move-Template Win2003_SP2 192.168.0.1 LUN6
(no error but the template did not move)

[vSphere PowerCLI] C:\tools &gt; Move-Template Win2003_SP2 192.168.0.1 LUN6
Move-Template : A parameter cannot be found that matches parameter name &quot;LUN6&quot;
at line:1 char:14
+ Move-Template &lt;&lt;&lt; .\Get-LinuxTemplates

&#039;&lt;&#039; operator is reserved for future use
at C:\tools\Get-LinuxTemplates.ps1:3 char:25
+     Move-Template $tpl &lt; &lt;&lt;&lt; 
    + CategoryInfo          : ParserError: (&lt;:OperatorToken) [], ParseException
    + FullyQualifiedErrorId : RedirectionNotSupported]]></description>
		<content:encoded><![CDATA[<p>&#8212;&#8212;=== SORRY, the following should be the correct output ===&#8212;&#8212;</p>
<p>[vSphere PowerCLI] C:\tools &gt; .\Move-Template Win2003_SP2 192.168.0.1 LUN6<br />
(no error but the template did not move)</p>
<p>[vSphere PowerCLI] C:\tools &gt; Move-Template Win2003_SP2 192.168.0.1 LUN6<br />
Move-Template : A parameter cannot be found that matches parameter name &#8220;LUN6&#8243;<br />
at line:1 char:14<br />
+ Move-Template &lt;&lt;&lt; .\Get-LinuxTemplates</p>
<p>&#039;&lt;&#039; operator is reserved for future use<br />
at C:\tools\Get-LinuxTemplates.ps1:3 char:25<br />
+     Move-Template $tpl &lt; &lt;&lt;&lt;<br />
    + CategoryInfo          : ParserError: (&lt;:OperatorToken) [], ParseException<br />
    + FullyQualifiedErrorId : RedirectionNotSupported</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PowerCLI: Move-Template by sean</title>
		<link>http://ict-freak.nl/2010/01/21/powercli-move-template/comment-page-1/#comment-18181</link>
		<dc:creator><![CDATA[sean]]></dc:creator>
		<pubDate>Wed, 01 Feb 2012 06:45:52 +0000</pubDate>
		<guid isPermaLink="false">http://ictfreak.wordpress.com/2010/01/21/powercli-move-template/#comment-18181</guid>
		<description><![CDATA[I got the following error, would you kindly help me out?

[vSphere PowerCLI] C:\tools &gt; .\Move-Template Win2003_SP2 192.168.0.1 LUN6
(no error but the template did not move)

[vSphere PowerCLI] C:\tools &gt; Move-Template Win2003_SP2 192.168.0.1 LUN6
Move-Template : A parameter cannot be found that matches parameter name &quot;LUN6&quot;
at line:1 char:14
+ Move-Template &lt;&lt;&lt; .\Get-LinuxTemplates

&#039;&lt;&#039; operator is reserved for future use
at C:\tools\Get-LinuxTemplates.ps1:3 char:25
+     Move-Template $tpl &lt; &lt;&lt;&lt; 
    + CategoryInfo          : ParserError: (&lt;:OperatorToken) [], ParseException
    + FullyQualifiedErrorId : RedirectionNotSupported]]></description>
		<content:encoded><![CDATA[<p>I got the following error, would you kindly help me out?</p>
<p>[vSphere PowerCLI] C:\tools &gt; .\Move-Template Win2003_SP2 192.168.0.1 LUN6<br />
(no error but the template did not move)</p>
<p>[vSphere PowerCLI] C:\tools &gt; Move-Template Win2003_SP2 192.168.0.1 LUN6<br />
Move-Template : A parameter cannot be found that matches parameter name &#8220;LUN6&#8243;<br />
at line:1 char:14<br />
+ Move-Template &lt;&lt;&lt; .\Get-LinuxTemplates</p>
<p>&#039;&lt;&#039; operator is reserved for future use<br />
at C:\tools\Get-LinuxTemplates.ps1:3 char:25<br />
+     Move-Template $tpl &lt; &lt;&lt;&lt;<br />
    + CategoryInfo          : ParserError: (&lt;:OperatorToken) [], ParseException<br />
    + FullyQualifiedErrorId : RedirectionNotSupported</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Powershell: Export Installed Software to Excel by AC</title>
		<link>http://ict-freak.nl/2009/08/27/powershell-export-installed-software-to-excel/comment-page-1/#comment-18080</link>
		<dc:creator><![CDATA[AC]]></dc:creator>
		<pubDate>Fri, 20 Jan 2012 00:03:44 +0000</pubDate>
		<guid isPermaLink="false">http://ictfreak.wordpress.com/2009/08/27/powershell-export-installed-software-to-excel/#comment-18080</guid>
		<description><![CDATA[Hamish, did you happen to update the script with the x64 ver?]]></description>
		<content:encoded><![CDATA[<p>Hamish, did you happen to update the script with the x64 ver?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PowerCLI: Upgrading vHardware to vSphere Part 2: VM&#8217;s by Luis</title>
		<link>http://ict-freak.nl/2009/07/15/powercli-upgrading-vhardware-to-vsphere-part-2-vms/comment-page-1/#comment-18069</link>
		<dc:creator><![CDATA[Luis]]></dc:creator>
		<pubDate>Wed, 18 Jan 2012 21:20:36 +0000</pubDate>
		<guid isPermaLink="false">http://ictfreak.wordpress.com/?p=4123#comment-18069</guid>
		<description><![CDATA[I&#039;ve made some changes to make it upgrade from v7 to v8 but i&#039;m not sure if it will work or not, what do you think 




Function PowerOn-VM($vm){

	Start-VM -VM $vm -Confirm:$false -RunAsync &#124; Out-Null
	
		do {
			$vmview = get-VM $vm &#124; Get-View
			$status = $vmview.Guest.ToolsStatus
	
				Write-Host $vm is starting! -ForegroundColor Yellow
				sleep 5
	
		}until(($status -match &quot;toolsOld&quot;) -or ($status -match &quot;toolsOk&quot;))
		
		if ($status -match &quot;Ok&quot;){
			$Startup = &quot;Ok&quot;}
		elseif($status -match &quot;toolsOld&quot;){
			$Startup = &quot;ToolsOld&quot;}
		else{
			$Startup = &quot;Not Ready&quot;}
		
		return $Startup

}

Function PowerOff-VM($vm){
		
		sleep 20
		Shutdown-VMGuest -VM $vm -Confirm:$false &#124; Out-Null
					
			do {
				$vmview = Get-VM $vm &#124; Get-View
				$status = $vmview.Guest.ToolsStatus
	
					Write-Host $vm is stopping! -ForegroundColor Yellow
					sleep 5
	
			}until($status -match &quot;toolsNotRunning&quot;) 
			if ($status -match &quot;toolsNotRunning&quot;){
			$Shutdown = &quot;Ok&quot;}
			else{
			$Shutdown = &quot;Not Ready&quot;}
			return $Shutdown	
}

Function Check-ToolsStatus($vm){

	$vmview = get-VM $vm &#124; Get-View
	$status = $vmview.Guest.ToolsStatus

		if ($status -match &quot;toolsOld&quot;){
			$vmTools = &quot;Old&quot;}
		elseif($status -match &quot;toolsNotRunning&quot;){
			$vmTools = &quot;Not Running&quot;}
		else{
			$vmTools = &quot;Ok&quot;}
		return $vmTools
}

Function Check-VMHardwareVersion($vm){
	$vmView = get-VM $vm &#124; Get-View
	$vmVersion = $vmView.Config.Version
	$v7 = &quot;vmx-07&quot;
	$v8 = &quot;vmx-08&quot;
	
		if ($vmVersion -eq $v7){
			$vmHardware = &quot;Old&quot;}
		elseif($vmVersion -eq $v8){
			$vmHardware = &quot;Ok&quot;}		
		else{Write-Host &quot;Error!!&quot; -ForegroundColor Red
			$vmHardware = &quot;Error&quot;}
		
		return $vmHardware
}

Function Upgrade-VMHardware($vm){

	$vmview = Get-VM $vm &#124; Get-View
	$vmVersion = $vmView.Config.Version
	$v7 = &quot;vmx-07&quot;
	$v8 = &quot;vmx-08&quot;

		if ($vmVersion -eq $v7){
			Write-Host &quot;Version 7 detected&quot; -ForegroundColor Red
			
			# Update Hardware
			Write-Host &quot;Upgrading Hardware on&quot; $vm -ForegroundColor Yellow
			Get-View ($vmView.UpgradeVM_Task($v8)) &#124; Out-Null
	}	
}

Function CreateBeforeList{

Write-Host &quot;Creating a CSV File with VM info&quot; -ForegroundColor Yellow

$MyCol = @()
   ForEach ($vm in Get-Folder $Folder &#124; Get-VM )
   {
   	$vmview = get-VM $vm &#124; Get-View
   
      $myObj = &quot;&quot; &#124; Select Host, VMName, PowerState, IPAddress, MacAddress, Nics, VMToolsVersion, VMToolsStatus, VMToolsRunningStatus
      $myObj.Host = $VM.Host.Name
      $myObj.VMName = $VM.Name
      $myObj.PowerState = $VM.PowerState
	  $myObj.IPAddress = [String]($vmview.Guest.Net&#124; ForEach {$_.IpAddress})
      $myObj.MacAddress = [String]($vmview.Guest.Net &#124; ForEach {$_.MacAddress})
	  $myObj.Nics = $vmview.Guest.Net.Count
	  $myObj.VMToolsVersion = $vmview.Config.Tools.ToolsVersion
	  $myObj.VMToolsStatus = $vmview.Guest.ToolsStatus
	  $myObj.VMToolsRunningStatus = $vmview.Guest.ToolsRunningStatus
	  
      $myCol += $myObj
    }
	$myCol &#124; Export-Csv C:\beforeHWchange.csv -NoTypeInformation 
}

Function CreateAfterList{

Write-Host &quot;Creating a CSV and an Excel File with VM info&quot; -ForegroundColor Yellow

$xlCSV = 6
$xlXLS = 56
$csvfile = &quot;C:\afterHWchange.csv&quot;
$xlsfile = &quot;C:\afterHWchange.xls&quot;

$Excel = New-Object -ComObject Excel.Application
$Excel.visible = $True
$Excel = $Excel.Workbooks.Add()

$Sheet = $Excel.Worksheets.Item(1)
$Sheet.Cells.Item(1,1) = &quot;VMName&quot;
$Sheet.Cells.Item(1,2) = &quot;IPAddress&quot;
$Sheet.Cells.Item(1,3) = &quot;Settings&quot;

$intRow = 2

$WorkBook = $Sheet.UsedRange
$WorkBook.Interior.ColorIndex = 19
$WorkBook.Font.ColorIndex = 11
$WorkBook.Font.Bold = $True


$import = Import-Csv &quot;C:\beforeHWchange.csv&quot;
$vms = Get-Folder $Folder &#124; Get-VM 

foreach($vm in $vms){
	$vmview = $vm &#124; Get-View

	foreach($item in $import){
	$oldIp = $item.IPAddress
	$newIP = $vm.Guest.IPAddress


		if($item.VMName -eq $vm){
			if($oldIp -eq $newIP){
				
				$Sheet.Cells.Item($intRow, 1) = [String]$vmview.Name 
				$Sheet.Cells.Item($intRow, 2) = [String]$vm.Guest.IPAddress
				$Sheet.Cells.Item($intRow, 3) = &quot;Good&quot;
				$Sheet.Cells.Item($intRow, 3).Interior.ColorIndex = 4
				}
				else{
				$Sheet.Cells.Item($intRow, 1) = [String]$vmview.Name 
				$Sheet.Cells.Item($intRow, 2) = [String]$vm.Guest.IPAddress
				$Sheet.Cells.Item($intRow, 3) = &quot;Wrong&quot;
				$Sheet.Cells.Item($intRow, 3).Interior.ColorIndex = 3
				
				}
		}
	}


$intRow = $intRow + 1}

$WorkBook.EntireColumn.AutoFit()

sleep 5

$Sheet.SaveAs($xlsfile,$xlXLS)
$Sheet.SaveAs($csvfile,$xlCSV) 

}


$vCenter = Read-Host &quot;Enter your vCenter servername&quot;
$Folder = Read-Host &quot;Enter the name of the folder where the VMs are stored&quot;

Connect-VIServer $vCenter

$vms = Get-Folder $Folder &#124; Get-VM  &#124; Get-View &#124; Where-Object {-not $_.config.template -and $_.Config.Version -eq &quot;vmx-04&quot; } &#124; Select Name

CreateBeforeList

foreach($item in $vms){	
		$vm = $item.Name
		$vmHardware = Check-VMHardwareVersion $vm
		$vmToolsStatus = Check-ToolsStatus $vm
		
			Write-Host &quot;Hardware is old on:&quot; $vm -ForegroundColor Red

					if($vmToolsStatus -eq &quot;Old&quot;){
							Write-Host &quot;The VMware Tools are old on:&quot; $vm -ForegroundColor Red
							Sleep 20
 							
							Get-VMGuest $vm &#124; Update-Tools
							Sleep 120
							Write-Host &quot;VMware Tools are installed on:&quot; $vm -ForegroundColor Cyan
								
								$vmToolsStatus = Check-ToolsStatus $vm
							
								if($vmToolsStatus -eq &quot;Ok&quot;){
									
									$PowerOffVM = PowerOff-VM $vm
									if($PowerOffVM -eq &quot;Ok&quot;){
										Write-Host $vm &quot;is down&quot; -ForegroundColor Yellow
										
										Upgrade-VMHardware $vm
										PowerOn-VM $vm
										Write-Host $vm &quot;is up to date&quot; -ForegroundColor Green
									}
								}
					
					}
					else{
						$PowerOffVM = PowerOff-VM $vm
						if($PowerOffVM -eq &quot;Ok&quot;){
							Upgrade-VMHardware $vm
							PowerOn-VM $vm
							Write-Host $vm &quot;is up to date&quot; -ForegroundColor Green
							
						}	
					}
}

Sleep 40

CreateAfterList

Disconnect-VIServer -Confirm:$false]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve made some changes to make it upgrade from v7 to v8 but i&#8217;m not sure if it will work or not, what do you think </p>
<p>Function PowerOn-VM($vm){</p>
<p>	Start-VM -VM $vm -Confirm:$false -RunAsync | Out-Null</p>
<p>		do {<br />
			$vmview = get-VM $vm | Get-View<br />
			$status = $vmview.Guest.ToolsStatus</p>
<p>				Write-Host $vm is starting! -ForegroundColor Yellow<br />
				sleep 5</p>
<p>		}until(($status -match &#8220;toolsOld&#8221;) -or ($status -match &#8220;toolsOk&#8221;))</p>
<p>		if ($status -match &#8220;Ok&#8221;){<br />
			$Startup = &#8220;Ok&#8221;}<br />
		elseif($status -match &#8220;toolsOld&#8221;){<br />
			$Startup = &#8220;ToolsOld&#8221;}<br />
		else{<br />
			$Startup = &#8220;Not Ready&#8221;}</p>
<p>		return $Startup</p>
<p>}</p>
<p>Function PowerOff-VM($vm){</p>
<p>		sleep 20<br />
		Shutdown-VMGuest -VM $vm -Confirm:$false | Out-Null</p>
<p>			do {<br />
				$vmview = Get-VM $vm | Get-View<br />
				$status = $vmview.Guest.ToolsStatus</p>
<p>					Write-Host $vm is stopping! -ForegroundColor Yellow<br />
					sleep 5</p>
<p>			}until($status -match &#8220;toolsNotRunning&#8221;)<br />
			if ($status -match &#8220;toolsNotRunning&#8221;){<br />
			$Shutdown = &#8220;Ok&#8221;}<br />
			else{<br />
			$Shutdown = &#8220;Not Ready&#8221;}<br />
			return $Shutdown<br />
}</p>
<p>Function Check-ToolsStatus($vm){</p>
<p>	$vmview = get-VM $vm | Get-View<br />
	$status = $vmview.Guest.ToolsStatus</p>
<p>		if ($status -match &#8220;toolsOld&#8221;){<br />
			$vmTools = &#8220;Old&#8221;}<br />
		elseif($status -match &#8220;toolsNotRunning&#8221;){<br />
			$vmTools = &#8220;Not Running&#8221;}<br />
		else{<br />
			$vmTools = &#8220;Ok&#8221;}<br />
		return $vmTools<br />
}</p>
<p>Function Check-VMHardwareVersion($vm){<br />
	$vmView = get-VM $vm | Get-View<br />
	$vmVersion = $vmView.Config.Version<br />
	$v7 = &#8220;vmx-07&#8243;<br />
	$v8 = &#8220;vmx-08&#8243;</p>
<p>		if ($vmVersion -eq $v7){<br />
			$vmHardware = &#8220;Old&#8221;}<br />
		elseif($vmVersion -eq $v8){<br />
			$vmHardware = &#8220;Ok&#8221;}<br />
		else{Write-Host &#8220;Error!!&#8221; -ForegroundColor Red<br />
			$vmHardware = &#8220;Error&#8221;}</p>
<p>		return $vmHardware<br />
}</p>
<p>Function Upgrade-VMHardware($vm){</p>
<p>	$vmview = Get-VM $vm | Get-View<br />
	$vmVersion = $vmView.Config.Version<br />
	$v7 = &#8220;vmx-07&#8243;<br />
	$v8 = &#8220;vmx-08&#8243;</p>
<p>		if ($vmVersion -eq $v7){<br />
			Write-Host &#8220;Version 7 detected&#8221; -ForegroundColor Red</p>
<p>			# Update Hardware<br />
			Write-Host &#8220;Upgrading Hardware on&#8221; $vm -ForegroundColor Yellow<br />
			Get-View ($vmView.UpgradeVM_Task($v8)) | Out-Null<br />
	}<br />
}</p>
<p>Function CreateBeforeList{</p>
<p>Write-Host &#8220;Creating a CSV File with VM info&#8221; -ForegroundColor Yellow</p>
<p>$MyCol = @()<br />
   ForEach ($vm in Get-Folder $Folder | Get-VM )<br />
   {<br />
   	$vmview = get-VM $vm | Get-View</p>
<p>      $myObj = &#8220;&#8221; | Select Host, VMName, PowerState, IPAddress, MacAddress, Nics, VMToolsVersion, VMToolsStatus, VMToolsRunningStatus<br />
      $myObj.Host = $VM.Host.Name<br />
      $myObj.VMName = $VM.Name<br />
      $myObj.PowerState = $VM.PowerState<br />
	  $myObj.IPAddress = [String]($vmview.Guest.Net| ForEach {$_.IpAddress})<br />
      $myObj.MacAddress = [String]($vmview.Guest.Net | ForEach {$_.MacAddress})<br />
	  $myObj.Nics = $vmview.Guest.Net.Count<br />
	  $myObj.VMToolsVersion = $vmview.Config.Tools.ToolsVersion<br />
	  $myObj.VMToolsStatus = $vmview.Guest.ToolsStatus<br />
	  $myObj.VMToolsRunningStatus = $vmview.Guest.ToolsRunningStatus</p>
<p>      $myCol += $myObj<br />
    }<br />
	$myCol | Export-Csv C:\beforeHWchange.csv -NoTypeInformation<br />
}</p>
<p>Function CreateAfterList{</p>
<p>Write-Host &#8220;Creating a CSV and an Excel File with VM info&#8221; -ForegroundColor Yellow</p>
<p>$xlCSV = 6<br />
$xlXLS = 56<br />
$csvfile = &#8220;C:\afterHWchange.csv&#8221;<br />
$xlsfile = &#8220;C:\afterHWchange.xls&#8221;</p>
<p>$Excel = New-Object -ComObject Excel.Application<br />
$Excel.visible = $True<br />
$Excel = $Excel.Workbooks.Add()</p>
<p>$Sheet = $Excel.Worksheets.Item(1)<br />
$Sheet.Cells.Item(1,1) = &#8220;VMName&#8221;<br />
$Sheet.Cells.Item(1,2) = &#8220;IPAddress&#8221;<br />
$Sheet.Cells.Item(1,3) = &#8220;Settings&#8221;</p>
<p>$intRow = 2</p>
<p>$WorkBook = $Sheet.UsedRange<br />
$WorkBook.Interior.ColorIndex = 19<br />
$WorkBook.Font.ColorIndex = 11<br />
$WorkBook.Font.Bold = $True</p>
<p>$import = Import-Csv &#8220;C:\beforeHWchange.csv&#8221;<br />
$vms = Get-Folder $Folder | Get-VM </p>
<p>foreach($vm in $vms){<br />
	$vmview = $vm | Get-View</p>
<p>	foreach($item in $import){<br />
	$oldIp = $item.IPAddress<br />
	$newIP = $vm.Guest.IPAddress</p>
<p>		if($item.VMName -eq $vm){<br />
			if($oldIp -eq $newIP){</p>
<p>				$Sheet.Cells.Item($intRow, 1) = [String]$vmview.Name<br />
				$Sheet.Cells.Item($intRow, 2) = [String]$vm.Guest.IPAddress<br />
				$Sheet.Cells.Item($intRow, 3) = &#8220;Good&#8221;<br />
				$Sheet.Cells.Item($intRow, 3).Interior.ColorIndex = 4<br />
				}<br />
				else{<br />
				$Sheet.Cells.Item($intRow, 1) = [String]$vmview.Name<br />
				$Sheet.Cells.Item($intRow, 2) = [String]$vm.Guest.IPAddress<br />
				$Sheet.Cells.Item($intRow, 3) = &#8220;Wrong&#8221;<br />
				$Sheet.Cells.Item($intRow, 3).Interior.ColorIndex = 3</p>
<p>				}<br />
		}<br />
	}</p>
<p>$intRow = $intRow + 1}</p>
<p>$WorkBook.EntireColumn.AutoFit()</p>
<p>sleep 5</p>
<p>$Sheet.SaveAs($xlsfile,$xlXLS)<br />
$Sheet.SaveAs($csvfile,$xlCSV) </p>
<p>}</p>
<p>$vCenter = Read-Host &#8220;Enter your vCenter servername&#8221;<br />
$Folder = Read-Host &#8220;Enter the name of the folder where the VMs are stored&#8221;</p>
<p>Connect-VIServer $vCenter</p>
<p>$vms = Get-Folder $Folder | Get-VM  | Get-View | Where-Object {-not $_.config.template -and $_.Config.Version -eq &#8220;vmx-04&#8243; } | Select Name</p>
<p>CreateBeforeList</p>
<p>foreach($item in $vms){<br />
		$vm = $item.Name<br />
		$vmHardware = Check-VMHardwareVersion $vm<br />
		$vmToolsStatus = Check-ToolsStatus $vm</p>
<p>			Write-Host &#8220;Hardware is old on:&#8221; $vm -ForegroundColor Red</p>
<p>					if($vmToolsStatus -eq &#8220;Old&#8221;){<br />
							Write-Host &#8220;The VMware Tools are old on:&#8221; $vm -ForegroundColor Red<br />
							Sleep 20</p>
<p>							Get-VMGuest $vm | Update-Tools<br />
							Sleep 120<br />
							Write-Host &#8220;VMware Tools are installed on:&#8221; $vm -ForegroundColor Cyan</p>
<p>								$vmToolsStatus = Check-ToolsStatus $vm</p>
<p>								if($vmToolsStatus -eq &#8220;Ok&#8221;){</p>
<p>									$PowerOffVM = PowerOff-VM $vm<br />
									if($PowerOffVM -eq &#8220;Ok&#8221;){<br />
										Write-Host $vm &#8220;is down&#8221; -ForegroundColor Yellow</p>
<p>										Upgrade-VMHardware $vm<br />
										PowerOn-VM $vm<br />
										Write-Host $vm &#8220;is up to date&#8221; -ForegroundColor Green<br />
									}<br />
								}</p>
<p>					}<br />
					else{<br />
						$PowerOffVM = PowerOff-VM $vm<br />
						if($PowerOffVM -eq &#8220;Ok&#8221;){<br />
							Upgrade-VMHardware $vm<br />
							PowerOn-VM $vm<br />
							Write-Host $vm &#8220;is up to date&#8221; -ForegroundColor Green</p>
<p>						}<br />
					}<br />
}</p>
<p>Sleep 40</p>
<p>CreateAfterList</p>
<p>Disconnect-VIServer -Confirm:$false</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PowerCLI: VMware Tools one-liners by Avoiding Those Pesky Reboots when Updating VMware Tools « Wahl Network</title>
		<link>http://ict-freak.nl/2011/02/09/powercli-vmware-tools-one-liners/comment-page-1/#comment-17886</link>
		<dc:creator><![CDATA[Avoiding Those Pesky Reboots when Updating VMware Tools « Wahl Network]]></dc:creator>
		<pubDate>Tue, 10 Jan 2012 02:46:07 +0000</pubDate>
		<guid isPermaLink="false">https://ictfreak.wordpress.com/2011/02/09/powercli-vmware-tools-one-liners/#comment-17886</guid>
		<description><![CDATA[[...] on the cmdlet here, or you can see some further examples on VMware’s KB site or on ICT-FREAK’s page of PowerCLI one-liners, but the basic code [...]]]></description>
		<content:encoded><![CDATA[<p>[...] on the cmdlet here, or you can see some further examples on VMware’s KB site or on ICT-FREAK’s page of PowerCLI one-liners, but the basic code [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PowerCLI: Enable Beacon Probing or Link Status Only on a vSwitch by Chadwick James King (@cwjking)</title>
		<link>http://ict-freak.nl/2010/10/06/powercli-enable-beacon-probing-or-link-status-only-on-a-vswitch/comment-page-1/#comment-17880</link>
		<dc:creator><![CDATA[Chadwick James King (@cwjking)]]></dc:creator>
		<pubDate>Mon, 09 Jan 2012 15:49:58 +0000</pubDate>
		<guid isPermaLink="false">https://ictfreak.wordpress.com/2010/10/06/powercli-enable-beacon-probing-or-link-status-only-on-a-vswitch/#comment-17880</guid>
		<description><![CDATA[It would be cool if this was doing it on distributed switches.  I only see this being done on virtual switches.  Even so, its a nice article on how to automate it.  Thanks for sharing!]]></description>
		<content:encoded><![CDATA[<p>It would be cool if this was doing it on distributed switches.  I only see this being done on virtual switches.  Even so, its a nice article on how to automate it.  Thanks for sharing!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PowerCLI: Easy iSCSI Send Target setup by Gestion des Storages iSCSI sous ESXi » vg5000.org</title>
		<link>http://ict-freak.nl/2011/06/16/powercli-easy-iscsi-send-target-setup/comment-page-1/#comment-17873</link>
		<dc:creator><![CDATA[Gestion des Storages iSCSI sous ESXi » vg5000.org]]></dc:creator>
		<pubDate>Mon, 09 Jan 2012 10:12:14 +0000</pubDate>
		<guid isPermaLink="false">https://ictfreak.wordpress.com/?p=5409#comment-17873</guid>
		<description><![CDATA[[...] http://xtravirt.co.uk/how-manage-iscsi-targets-with-powercli-part-1 http://ict-freak.nl/2011/06/16/powercli-easy-iscsi-send-target-setup/ http://communities.vmware.com/docs/DOC-7400 [...]]]></description>
		<content:encoded><![CDATA[<p>[...] <a href="http://xtravirt.co.uk/how-manage-iscsi-targets-with-powercli-part-1" rel="nofollow">http://xtravirt.co.uk/how-manage-iscsi-targets-with-powercli-part-1</a> <a href="http://ict-freak.nl/2011/06/16/powercli-easy-iscsi-send-target-setup/" rel="nofollow">http://ict-freak.nl/2011/06/16/powercli-easy-iscsi-send-target-setup/</a> <a href="http://communities.vmware.com/docs/DOC-7400" rel="nofollow">http://communities.vmware.com/docs/DOC-7400</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Powershell: Export Installed Software to Excel by Rony</title>
		<link>http://ict-freak.nl/2009/08/27/powershell-export-installed-software-to-excel/comment-page-1/#comment-17768</link>
		<dc:creator><![CDATA[Rony]]></dc:creator>
		<pubDate>Wed, 04 Jan 2012 15:07:56 +0000</pubDate>
		<guid isPermaLink="false">http://ictfreak.wordpress.com/2009/08/27/powershell-export-installed-software-to-excel/#comment-17768</guid>
		<description><![CDATA[Hi! I use a command line to get that list:
http://runakay.blogspot.com/2011/12/exporting-all-installed-applications-in.html]]></description>
		<content:encoded><![CDATA[<p>Hi! I use a command line to get that list:<br />
<a href="http://runakay.blogspot.com/2011/12/exporting-all-installed-applications-in.html" rel="nofollow">http://runakay.blogspot.com/2011/12/exporting-all-installed-applications-in.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Veeam Backup PowerShell Toolkit by Powershell: Veeam B&#38;R &#8211; Get total days before the license expires &#171; ICT-Freak.nl</title>
		<link>http://ict-freak.nl/2010/10/26/veeam-backup-powershell-toolkit/comment-page-1/#comment-17764</link>
		<dc:creator><![CDATA[Powershell: Veeam B&#38;R &#8211; Get total days before the license expires &#171; ICT-Freak.nl]]></dc:creator>
		<pubDate>Wed, 04 Jan 2012 09:38:35 +0000</pubDate>
		<guid isPermaLink="false">https://ictfreak.wordpress.com/?p=5000#comment-17764</guid>
		<description><![CDATA[[...] where Veeam B&amp;R holds the license information. I couldn’t find the license info with the Veeam Powershell Toolkit. So the next step was to find the info inside the Veeam Backup Database but I couldn’t find it [...]]]></description>
		<content:encoded><![CDATA[<p>[...] where Veeam B&amp;R holds the license information. I couldn’t find the license info with the Veeam Powershell Toolkit. So the next step was to find the info inside the Veeam Backup Database but I couldn’t find it [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
