<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
	<title>Comments for 8net.co.uk</title>
	
	<link>http://www.8net.co.uk</link>
	<description />
	<lastBuildDate>Sun, 22 Apr 2012 17:59:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/CommentsFor8netcouk" /><feedburner:info uri="commentsfor8netcouk" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FCommentsFor8netcouk" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FCommentsFor8netcouk" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/CommentsFor8netcouk" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FCommentsFor8netcouk" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FCommentsFor8netcouk" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FCommentsFor8netcouk" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FCommentsFor8netcouk" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><item>
		<title>Comment on VirtualBox and VM cloning by Don L</title>
		<link>http://feedproxy.google.com/~r/CommentsFor8netcouk/~3/VOJXdQYf4Pw/</link>
		<dc:creator>Don L</dc:creator>
		<pubDate>Sun, 22 Apr 2012 17:59:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.8net.co.uk/?p=664#comment-54</guid>
		<description>I know this is an old thread, but I think I'd mention this anyway.

I've had great success invoking the VirtualBox API directly - so no need to invoke an EXE file at all.

Try running:
PS&gt;$vBox = New-Object -ComObject VirtualBox.VirtualBox
PS&gt;$vBox | Get-Member
Then you'll see the functions and methods of the API.

It's worth downloading the API documentation from Oracle; they mention a lot of things here (though it's not as well documented as I'd hoped for; I'd like more code examples....)

An example of how to do this: I wrote the following code to be able to quickly create a differencing disk based on any of my templates.
The 

param ([string]$TemplatePath, [string]$DiffFormat = "vdi", [string]$DiffPath)

#Set defaults so you don't have to type the full path each time. If no drive letter is given, just append the input to the default paths.
$RootFolder = "c:\VMs"
$TemplateFolder = "c:\VMs\_Templates"

$MediumFixed = 65536
$MediumDiff = 131072

$vBox = New-Object -ComObject VirtualBox.VirtualBox
If ($? -eq $False) {
  Write-Host "Connection to VBox COM object failed."
  Return
}
If ($TemplatePath -eq $null) {
  Write-Host "Error. Missing parameter TemplatePath parameter."
  Return
}
If ($DiffPath -eq $null) {
  Write-Host "Error. Missing DiffPath parameter."
  Return
}

$TemplateFilePath = "$TemplatePath"
If ($TemplatePath.Length -gt 3) {
  If ($TemplatePath.Substring(1,2) -ne ":\") {
    $TemplateFilePath = "$TemplateFolder\$TemplatePath"
  }
}

$DiffFilePath = "$DiffPath"
If ($DiffPath.Length -gt 3) {
  If ($DiffPath.Substring(1,2) -ne ":\") {
    $DiffFilePath = "$RootFolder\$DiffPath"
  }
}

$DiffHD = $vBox.CreateHardDisk($DiffFormat, $DiffFilePath)
If ($? -ne $True) {
  Write-Error "Error trying to prepare the differencing hard disk."
  Return
}
$HDDDevType = $diffHD.DeviceType

$TemplateHD = $vBox.FindMedium($TemplateFilePath, $HDDDevType)
If ($? -ne $True) {
  Write-Error "Error finding the template, or the template is not a proper hard disk file."
  Return
}

$CreateResult = $TemplateHD.CreateDiffStorage($DiffHD, $MediumDiff)
If ($? -ne $True -or $CreateResult.Resultcode -ne $Null) {
  $ErrorMessage = $CreateResult.Resultcode
  If ($ErrorMessage = -2135228412) { $ErrorMessage = "0x80BB0004 VBOX_E_FILE_ERROR" }
  Write-Error "Error creating the differencing hard disk.
$ErrorMessage"
  Return
}</description>
		<content:encoded><![CDATA[<p>I know this is an old thread, but I think I&#8217;d mention this anyway.</p>
<p>I&#8217;ve had great success invoking the VirtualBox API directly &#8211; so no need to invoke an EXE file at all.</p>
<p>Try running:<br />
PS&gt;$vBox = New-Object -ComObject VirtualBox.VirtualBox<br />
PS&gt;$vBox | Get-Member<br />
Then you&#8217;ll see the functions and methods of the API.</p>
<p>It&#8217;s worth downloading the API documentation from Oracle; they mention a lot of things here (though it&#8217;s not as well documented as I&#8217;d hoped for; I&#8217;d like more code examples&#8230;.)</p>
<p>An example of how to do this: I wrote the following code to be able to quickly create a differencing disk based on any of my templates.<br />
The </p>
<p>param ([string]$TemplatePath, [string]$DiffFormat = &#8220;vdi&#8221;, [string]$DiffPath)</p>
<p>#Set defaults so you don&#8217;t have to type the full path each time. If no drive letter is given, just append the input to the default paths.<br />
$RootFolder = &#8220;c:\VMs&#8221;<br />
$TemplateFolder = &#8220;c:\VMs\_Templates&#8221;</p>
<p>$MediumFixed = 65536<br />
$MediumDiff = 131072</p>
<p>$vBox = New-Object -ComObject VirtualBox.VirtualBox<br />
If ($? -eq $False) {<br />
  Write-Host &#8220;Connection to VBox COM object failed.&#8221;<br />
  Return<br />
}<br />
If ($TemplatePath -eq $null) {<br />
  Write-Host &#8220;Error. Missing parameter TemplatePath parameter.&#8221;<br />
  Return<br />
}<br />
If ($DiffPath -eq $null) {<br />
  Write-Host &#8220;Error. Missing DiffPath parameter.&#8221;<br />
  Return<br />
}</p>
<p>$TemplateFilePath = &#8220;$TemplatePath&#8221;<br />
If ($TemplatePath.Length -gt 3) {<br />
  If ($TemplatePath.Substring(1,2) -ne &#8220;:\&#8221;) {<br />
    $TemplateFilePath = &#8220;$TemplateFolder\$TemplatePath&#8221;<br />
  }<br />
}</p>
<p>$DiffFilePath = &#8220;$DiffPath&#8221;<br />
If ($DiffPath.Length -gt 3) {<br />
  If ($DiffPath.Substring(1,2) -ne &#8220;:\&#8221;) {<br />
    $DiffFilePath = &#8220;$RootFolder\$DiffPath&#8221;<br />
  }<br />
}</p>
<p>$DiffHD = $vBox.CreateHardDisk($DiffFormat, $DiffFilePath)<br />
If ($? -ne $True) {<br />
  Write-Error &#8220;Error trying to prepare the differencing hard disk.&#8221;<br />
  Return<br />
}<br />
$HDDDevType = $diffHD.DeviceType</p>
<p>$TemplateHD = $vBox.FindMedium($TemplateFilePath, $HDDDevType)<br />
If ($? -ne $True) {<br />
  Write-Error &#8220;Error finding the template, or the template is not a proper hard disk file.&#8221;<br />
  Return<br />
}</p>
<p>$CreateResult = $TemplateHD.CreateDiffStorage($DiffHD, $MediumDiff)<br />
If ($? -ne $True -or $CreateResult.Resultcode -ne $Null) {<br />
  $ErrorMessage = $CreateResult.Resultcode<br />
  If ($ErrorMessage = -2135228412) { $ErrorMessage = &#8220;0x80BB0004 VBOX_E_FILE_ERROR&#8221; }<br />
  Write-Error &#8220;Error creating the differencing hard disk.<br />
$ErrorMessage&#8221;<br />
  Return<br />
}</p>
<img src="http://feeds.feedburner.com/~r/CommentsFor8netcouk/~4/VOJXdQYf4Pw" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://www.8net.co.uk/virtualbox-and-vm-cloning/comment-page-1/#comment-54</feedburner:origLink></item>
	<item>
		<title>Comment on UAG/TMG and NIC Teaming by new free ipad</title>
		<link>http://feedproxy.google.com/~r/CommentsFor8netcouk/~3/EPvI2_hsQ5k/</link>
		<dc:creator>new free ipad</dc:creator>
		<pubDate>Sun, 08 Apr 2012 22:35:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.8net.co.uk/?p=772#comment-53</guid>
		<description>&lt;strong&gt;......&lt;/strong&gt;

A powerful share, I simply given this onto a colleague who was doing somewhat analysis on this. And ...</description>
		<content:encoded><![CDATA[<p><strong>&#8230;&#8230;</strong></p>
<p>A powerful share, &#073; simply &#103;&#105;&#118;&#101;&#110; &#116;&#104;&#105;&#115; &#111;&#110;&#116;&#111; &#097; colleague &#119;&#104;&#111; &#119;&#097;&#115; &#100;&#111;&#105;&#110;&#103; somewhat analysis &#111;&#110; this. &#065;&#110;&#100; &#8230;</p>
<img src="http://feeds.feedburner.com/~r/CommentsFor8netcouk/~4/EPvI2_hsQ5k" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://www.8net.co.uk/uag-tmg-and-nic-teaming/comment-page-1/#comment-53</feedburner:origLink></item>
	<item>
		<title>Comment on IPv6 and Win7 by Pritesh</title>
		<link>http://feedproxy.google.com/~r/CommentsFor8netcouk/~3/nrrCcwW07QQ/</link>
		<dc:creator>Pritesh</dc:creator>
		<pubDate>Sun, 07 Aug 2011 12:35:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.8net.co.uk/?p=757#comment-49</guid>
		<description>Found the web site where I got the above information: http://itexpertvoice.com/home/troubleshooting-ipv6-on-windows-7-and-why-its-worth-the-bother/</description>
		<content:encoded><![CDATA[<p>Found the web site where I got the above information: <a href="http://itexpertvoice.com/home/troubleshooting-ipv6-on-windows-7-and-why-its-worth-the-bother/" rel="nofollow">http://itexpertvoice.com/home/troubleshooting-ipv6-on-windows-7-and-why-its-worth-the-bother/</a></p>
<img src="http://feeds.feedburner.com/~r/CommentsFor8netcouk/~4/nrrCcwW07QQ" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://www.8net.co.uk/ipv6-and-win7/comment-page-1/#comment-49</feedburner:origLink></item>
	<item>
		<title>Comment on PowerShell edit function by Pritesh</title>
		<link>http://feedproxy.google.com/~r/CommentsFor8netcouk/~3/OEb8ALd9WME/</link>
		<dc:creator>Pritesh</dc:creator>
		<pubDate>Wed, 06 Apr 2011 11:57:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.8net.co.uk/?p=728#comment-45</guid>
		<description>Thanks Jeff, didn't know about the psedit function in ISE. I've thought long and hard for an argument to support the script: I shaved off two letters in the command? Just kidding. I wanted something that was uniform to both environments, one of the things I would like to add is the ability to create a file if it doesn't exist - my next action on this script.

(I'm going to need a to-do list just for PowerShell).</description>
		<content:encoded><![CDATA[<p>Thanks Jeff, didn&#8217;t know about the psedit function in ISE. I&#8217;ve thought long and hard for an argument to support the script: I shaved off two letters in the command? Just kidding. I wanted something that was uniform to both environments, one of the things I would like to add is the ability to create a file if it doesn&#8217;t exist &#8211; my next action on this script.</p>
<p>(I&#8217;m going to need a to-do list just for PowerShell).</p>
<img src="http://feeds.feedburner.com/~r/CommentsFor8netcouk/~4/OEb8ALd9WME" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://www.8net.co.uk/powershell-edit-function/comment-page-1/#comment-45</feedburner:origLink></item>
	<item>
		<title>Comment on PowerShell edit function by Jeffery Hicks</title>
		<link>http://feedproxy.google.com/~r/CommentsFor8netcouk/~3/dnwG-rPkkmY/</link>
		<dc:creator>Jeffery Hicks</dc:creator>
		<pubDate>Sun, 03 Apr 2011 13:59:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.8net.co.uk/?p=728#comment-43</guid>
		<description>To be clear, if you are in the console invoking the PS1 script will probably open Notepad or whatever application you have associated with the extension. In the ISE I also think there is default function called psedit

psedit myfile.ps1

Finally, since you aren't processing any pipelined objects, you don't really need the Begin and End script blocks.  But overall a good construct.</description>
		<content:encoded><![CDATA[<p>To be clear, if you are in the console invoking the PS1 script will probably open Notepad or whatever application you have associated with the extension. In the ISE I also think there is default function called psedit</p>
<p>psedit myfile.ps1</p>
<p>Finally, since you aren&#8217;t processing any pipelined objects, you don&#8217;t really need the Begin and End script blocks.  But overall a good construct.</p>
<img src="http://feeds.feedburner.com/~r/CommentsFor8netcouk/~4/dnwG-rPkkmY" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://www.8net.co.uk/powershell-edit-function/comment-page-1/#comment-43</feedburner:origLink></item>
	<item>
		<title>Comment on VirtualBox and VM cloning by PowerCamp London 19-20Mar11 | 8net.co.uk</title>
		<link>http://feedproxy.google.com/~r/CommentsFor8netcouk/~3/lXaoocf_YA8/</link>
		<dc:creator>PowerCamp London 19-20Mar11 | 8net.co.uk</dc:creator>
		<pubDate>Sat, 26 Mar 2011 17:21:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.8net.co.uk/?p=664#comment-42</guid>
		<description>[...] You can see an example of the PowerShell community at work on my blog – Jeffery Hicks helping me to make better scripts through comments, better post a question on Twitter with #PowerShell in your message. You can also check out a before and after of a function I wrote to see how much PowerShell has helped me: virtualbox and vm cloning. [...]</description>
		<content:encoded><![CDATA[<p>[...] You can see an example of the PowerShell community at work on my blog &#8211; Jeffery Hicks helping me to make better scripts through comments, better post a question on Twitter with #PowerShell in your message. You can also check out a before and after of a function I wrote to see how much PowerShell has helped me: virtualbox and vm cloning. [...]</p>
<img src="http://feeds.feedburner.com/~r/CommentsFor8netcouk/~4/lXaoocf_YA8" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://www.8net.co.uk/virtualbox-and-vm-cloning/comment-page-1/#comment-42</feedburner:origLink></item>
	<item>
		<title>Comment on VirtualBox and VM cloning by Pritesh</title>
		<link>http://feedproxy.google.com/~r/CommentsFor8netcouk/~3/MPkxwbHPVN8/</link>
		<dc:creator>Pritesh</dc:creator>
		<pubDate>Fri, 25 Mar 2011 13:09:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.8net.co.uk/?p=664#comment-41</guid>
		<description>Oh yea!! Bring it on Jeffery!! Thank you for the feed back - there shall be a round three!! :)</description>
		<content:encoded><![CDATA[<p>Oh yea!! Bring it on Jeffery!! Thank you for the feed back &#8211; there shall be a round three!! <img src='http://www.8net.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/CommentsFor8netcouk/~4/MPkxwbHPVN8" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://www.8net.co.uk/virtualbox-and-vm-cloning/comment-page-1/#comment-41</feedburner:origLink></item>
	<item>
		<title>Comment on VirtualBox and VM cloning by Jeffery Hicks</title>
		<link>http://feedproxy.google.com/~r/CommentsFor8netcouk/~3/BBnK5lFCNNE/</link>
		<dc:creator>Jeffery Hicks</dc:creator>
		<pubDate>Thu, 24 Mar 2011 19:41:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.8net.co.uk/?p=664#comment-40</guid>
		<description>If you don't mind a little more constructive feedback, which I think will help with future scripts and functions.  First, I always recommend casting your parameter variables to the proper type.

[string]$base

Since you aren't pipelining anything into the function the Begin/Process/End scriptblocks are irrelevant. I think you can just enter your code.

Take a look at Join-Path for constructing paths. I think it is a little easier to use and makes you less prone to concatenation errors.

What happens if the CreateVM expression fails? Or any of the other Invoke-Expression commands?

Since you are using cmdletbinding, why not add some Write-Verbose lines so the user can track what is happening or troubleshoot? All of your comments could easily become Write-Verbose lines. I also use Write-Verbose to show values of variables and parameters.

Finally, when you are ready to really go to the next level, you can add SupportsShouldProcess to the function (-WhatIf).  But that's the cherry on top of the icing on the cake.

Keep up the good work.</description>
		<content:encoded><![CDATA[<p>If you don&#8217;t mind a little more constructive feedback, which I think will help with future scripts and functions.  First, I always recommend casting your parameter variables to the proper type.</p>
<p>[string]$base</p>
<p>Since you aren&#8217;t pipelining anything into the function the Begin/Process/End scriptblocks are irrelevant. I think you can just enter your code.</p>
<p>Take a look at Join-Path for constructing paths. I think it is a little easier to use and makes you less prone to concatenation errors.</p>
<p>What happens if the CreateVM expression fails? Or any of the other Invoke-Expression commands?</p>
<p>Since you are using cmdletbinding, why not add some Write-Verbose lines so the user can track what is happening or troubleshoot? All of your comments could easily become Write-Verbose lines. I also use Write-Verbose to show values of variables and parameters.</p>
<p>Finally, when you are ready to really go to the next level, you can add SupportsShouldProcess to the function (-WhatIf).  But that&#8217;s the cherry on top of the icing on the cake.</p>
<p>Keep up the good work.</p>
<img src="http://feeds.feedburner.com/~r/CommentsFor8netcouk/~4/BBnK5lFCNNE" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://www.8net.co.uk/virtualbox-and-vm-cloning/comment-page-1/#comment-40</feedburner:origLink></item>
	<item>
		<title>Comment on VirtualBox and VM cloning by Pritesh</title>
		<link>http://feedproxy.google.com/~r/CommentsFor8netcouk/~3/IyWbRR4iZDw/</link>
		<dc:creator>Pritesh</dc:creator>
		<pubDate>Thu, 24 Mar 2011 18:31:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.8net.co.uk/?p=664#comment-39</guid>
		<description>Yup, removed the line altogether.</description>
		<content:encoded><![CDATA[<p>Yup, removed the line altogether.</p>
<img src="http://feeds.feedburner.com/~r/CommentsFor8netcouk/~4/IyWbRR4iZDw" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://www.8net.co.uk/virtualbox-and-vm-cloning/comment-page-1/#comment-39</feedburner:origLink></item>
	<item>
		<title>Comment on VirtualBox and VM cloning by Pritesh</title>
		<link>http://feedproxy.google.com/~r/CommentsFor8netcouk/~3/Dd4XjB9ZYmA/</link>
		<dc:creator>Pritesh</dc:creator>
		<pubDate>Thu, 24 Mar 2011 18:30:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.8net.co.uk/?p=664#comment-38</guid>
		<description>Thanks for the feed back 0.02, now named Copy-VM to fit with the verb-noun structure has this :).</description>
		<content:encoded><![CDATA[<p>Thanks for the feed back 0.02, now named Copy-VM to fit with the verb-noun structure has this <img src='http://www.8net.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<img src="http://feeds.feedburner.com/~r/CommentsFor8netcouk/~4/Dd4XjB9ZYmA" height="1" width="1"/>]]></content:encoded>
	<feedburner:origLink>http://www.8net.co.uk/virtualbox-and-vm-cloning/comment-page-1/#comment-38</feedburner:origLink></item>
</channel>
</rss>

