Permalink
Browse files

Updated readme. http://geekafterfive.com/2011/09/06/vmware-vcloud-pow…

  • Loading branch information...
1 parent 35c1c5b commit 20e02665b75cb91104a4d580e6684822d3cbda9b Jake Robinson committed Sep 8, 2011
Showing with 15 additions and 7 deletions.
  1. +3 −2 README
  2. +12 −5 vcloud-functions.ps1
View
5 README
@@ -1,7 +1,8 @@
-Get-vCloud
+vCloud Powershell function library for VMware's vCloud API.
-Get-vCloud is a Powershell function library for VMware's vCloud API.
+THIS WILL SOON BE DEPRECATED!
+SEE THIS POST: http://geekafterfive.com/2011/09/06/vmware-vcloud-powercli-snapin/
Installation
View
@@ -99,6 +99,11 @@ function Connect-vCloud
PROCESS
{
# we have to convert the password to plaintext. :(
+
+ if (!$username -or !$password -or !$org -or !$credential)
+ {
+ $credential = get-credential
+ }
try
{
$global:connection = new-object PSObject
@@ -287,9 +292,9 @@ function Post-vCloudURI
$request.ContentType = $contentType
#build our content from xml
$xmlString = $postData
- $xmlEnc = [System.Text.Encoding]::UTF8.GetBytes($xmlString)
+ [byte[]]$xmlEnc = [System.Text.Encoding]::UTF8.GetBytes($xmlString)
$request.ContentLength = $xmlEnc.length
- $requestStream = $request.GetRequestStream()
+ [System.IO.Stream]$requestStream = $request.GetRequestStream()
$requestStream.write($xmlEnc, 0, $xmlEnc.Length)
$requestStream.Close()
}
@@ -391,10 +396,12 @@ function Get-vCloudvApp
$vAppArray = @()
ForEach ($vAppURI in $vAppURIs)
{
- $vApp = Get-vCloudURI $vAppURI.href
- $vAppArray += $vApp.xmldata.vapp
+ if ($vAppURI.href)
+ {
+ $vApp = Get-vCloudURI $vAppURI.href
+ $vAppArray += $vApp.xmldata.vapp
+ }
}
-
return $vAppArray
}
}

0 comments on commit 20e0266

Please sign in to comment.