http://www.powershelltoys.com/ allows you to run PS commands over the Web...
Here is an example for connecting to a host, listing the datastores, guests and VMDKs:
<html>
<head>
</head>
<body>
<%Add-PSSnapin VMware.VimAutomation.Core%>
<%$host1 = Connect-VIServer -server 192.168.0.1 -user myuser -password mypass%>
<%$hostinfo = get-vmhost%>
<b>VMware.VimAutomation.Types.VMHost</b></br>
Host: <% $hostinfo.Name %></br>
Host Id: <% $hostinfo.Id %></br>
Host State: <% $hostinfo.State %></br></br>
<b>VMware.VimAutomation.Client20.DatastoreImpl</b></br>
<% $ds = Get-Datastore -VMHost $hostinfo %>
<% $ds | % { %>
<% $_.Name %></br>
<% } %>
</br>
<b>VMware.VimAutomation.Types.VirtualMachine</b></br>
Guests:</br>
<table>
<% Get-VM | % { %>
<tr>
<td><% ($_.Name) %></td>
<td><% ($_.Description) %></td>
<td><% ($_.PowerState) %></td>
<td><% ($_.Guest.State) %></td>
<td><% ($_.Guest.IPAddress) %></td>
<td>
<% $diskInfo = $_.Guest.Disks %>
<% $diskInfo | % { %>
<td><% $_.Path %></td>
<% } %>
</td>
<td>
<% $harddisks = Get-HardDisk -VM $_ %>
<% $harddisks | % { %>
<td><% $_.Filename %></td>
<% } %>
</td>
</tr>
<% } %>
</table>
</br></br>
</body>
</html>
This disconnect line will fail (it attempts to change the window title per c_shanklin):
<% Disconnect-VIServer -server $host1 -whatif:$true -confirm:$false %>
Alternate Disconnect Code:
<% (get-view serviceinstance).Client.Logout() %>
And Here is the Output:
VMware.VimAutomation.Types.VMHost
Host: 192.168.0.1
Host Id: HostSystem-ha-host
Host State: Connected
VMware.VimAutomation.Client20.DatastoreImpl
datastore1
VMware.VimAutomation.Types.VirtualMachine
Guests:
VM1 Windows 2003 x86 PoweredOn Running 192.168.0.1 C:\ [datastore1] VM1/VM1.vmdk
VM2 Windows 2003 x86 PoweredOn Running 192.168.0.3 C:\ [datastore1] VM2/VM2.vmdk
VM3 Windows 2003 x86 PoweredOff NotRunning [datastore1] VM3/VM4.vmdk
VM4 Windows 2003 x86 PoweredOff NotRunning
And here is how to catch the response to a file:
$xmlhttp = New-Object -ComObject Msxml2.XMLHTTP.3.0
$xmlhttp.open("GET","http://somewhere.com/myhoststate.ps1x", $false);
$xmlhttp.send();
$s = $xmlhttp.responseText
Add-Content "c:\temp\resp.txt" -Value $S