A little too much code to past directly on SquareSpace (haven't had time to figure out a way around that) but here it is.
Update on 2012-11-28 14:39 by Paul Fulbright
As I've had a couple questions I figured I'd post this. Once you install the snapin you need to run the following command (most likely with admin rights), why they don't do this as part of the install I don't know, I could see there being some "security" reason.
PS C:\Windows\Microsoft.NET\Framework64\v4.0.30319> .\InstallUtil.exe 'C:\Program Files (x86)\Citrix\XenServerPSSnapIn\XenServerPSSnapIn.dll'
It should spit out some text that ends with "The COmmit phase completed seuccessfully. The transacted install has completed."
This is step one of two in destroying (and then re-creating) a CIFS ISO library in XenServer, the reasons you may need to do this are varied, this is personally useful to me in a lab environment when the repo location or user credentials may change often. Everythign below requires the XenServer PSSnapin.
First thing we want to do is snag the info for the SR we want to delete:
$sr = Get-XenServer:SR | Where-Object {$_.content_type -eq "iso" -and $_.type -ne "udev" -and $_.name_label -ne "XenServer Tools"}
This filters out the CD-ROM (udev) and XS Tools and just returns us SR's whose content type is ISO, so it shouldn't matter what you name your repo (um, as long as you don't name it XenServer Tools I guess).
Now we need to unplug it:
foreach($i in $sr.PBDs){Invoke-XenServer:PBD.Unplug -SR $i}
Do you need to foreach this? Probably not. But if you DO happen to set it up with multiple PBD's then it will still fail on the next step because you only unplugged some of the PBD's, when in doubt, be thorough.
Now lets remove the SR:
Invoke-XenServer:SR.Forget -SR $sr.name_label
There you go, the next step will be to ask for a path, user and password to create a new ISO Library, which I'll cover next time.