Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
chelnak committed Feb 23, 2018
2 parents 485b496 + ee5397c commit 9d14291
Show file tree
Hide file tree
Showing 14 changed files with 347 additions and 234 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ Note: this module is not in any way developed or supported by anyone officially

|||||||
| --- | --- | --- | --- | --- | --- |
|6.2.4*|7.0|7.0.1|7.1|7.2*|7.3*|
|6.2.4*|7.0|7.0.1|7.1|7.2|7.3|


* Support for 6.2.4 is limited given API restrictions. Functions which don't support 6.2.4 will exit early and cleanly.
* Support for 7.2 and 7.3 has only received minor testing and updates so far

### PowerShell Editions

Expand All @@ -39,7 +38,7 @@ Install-Module -Name PowervRA -Scope CurrentUser
Once you have installed and imported PowervRA, use Connect-vRAServer to connect to your vRA instance:

```PowerShell
Connect-vRAServer -Server vra.corp.local -Tenant tenant01 -Credential (Get-Credential)
Connect-vRAServer -Server vra.corp.local -Tenant tenant01 -Credential (Get-Credential)
```

If your instance has a self signed certificate you must use the **IgnoreCertRequirements** switch:
Expand All @@ -49,7 +48,7 @@ Connect-vRAServer -Server vra.corp.local -Tenant tenant01 -Credential (Get-Crede
```

## Running Locally
When developing, use the provided build script and import the module that is inside the Release directory.
When developing, use the provided build script and import the module that is inside the Release directory.

You **do not** have to manually edit src\PowervRA.psd1 when adding new functions

Expand Down
20 changes: 3 additions & 17 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
## Breaking Changes
**WARNING: This release contains breaking changes**
* The minmum supported PowerShell Versions have been raised to the following:
* Windows PowerShell: 5.1
* PowerShell Core: 6.0.0-rc**

## Features
* Feature - Add ability to select SSL Protocol (#159)
* Feature - Single PSM1 file to speed up load times
* Feature - Add -Wait Parameter to Request-vRAResourceAction (@Thitho007)
* Feature - Get-vRAResource enhancements (#171) (@BlackCatDeployment)

## Fixes
* Fixed #134 - Issue with double quotes in some functions
* Fixed #135 - Some private functions are being exported
* Fixed #137 - Help examples for Get-vRAResource are incorrect
* Fixed #148 - Request-vRAResourceAction Example Correction
* Fixed #149 - Support Reservation Type change from 'vSphere' to 'vSphere (vCenter)' in vRA 7.3
* Fixed #151 - Get-vRAReservationPolicy
* Fixed #153 - New-vRAReserveration Error
* Fixed #130 - Unable to connect after removing SSLv3/TLSv1 ciphers from vRA Appliance
* Fixed #173 - Consider using Module Tags in addition to PSEditions
* Fixed #175 - Use ConvertTo-Json in Connect-vRAServer (@mponton)
22 changes: 20 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# Version 3.1.1
## Features
* Feature - Get-vRAResource enhancements (#171) (@BlackCatDeployment)

## Fixes
* Fixed #173 - Consider using Module Tags in addition to PSEditions
* Fixed #175 - Use ConvertTo-Json in Connect-vRAServer (@mponton)

# Version 3.1.0
## Features
* Feature - New function Remove-vRAReservationStorage (#157) (@skunkie)
* Feature - New function Get-vRARequestDetail (#167) (@otabut)
* Feature - Listed as PS Core compatible module in PS Gallery
* Feature - Supported on vRA 7.2 and 7.3

## Fixes
* Fixed #168 - Get-vRATenantDirectory does not support multiple directories in the API response

# Version 3.0.0
## Breaking Changes
**WARNING: This release contains breaking changes**
Expand Down Expand Up @@ -73,8 +91,8 @@
* Module restructured to use ps1 files for functions instead of psm1 files
* Private functions are now actually private
* Public functions restructured in to endpoint folders
* Removed depricated functions: Export-vRAContentPackage, Get-vRAContentPackage, Import-vRAContentPackage, Remove-vRAContentPackage,
Test-vRAContentPackage, Get-vRAConsumerCatalogItem, Get-vRAConsumerCatalogItemRequestTemplate, Get-vRAConsumerEntitledCatalogItem,
* Removed depricated functions: Export-vRAContentPackage, Get-vRAContentPackage, Import-vRAContentPackage, Remove-vRAContentPackage,
Test-vRAContentPackage, Get-vRAConsumerCatalogItem, Get-vRAConsumerCatalogItemRequestTemplate, Get-vRAConsumerEntitledCatalogItem,
Get-vRAConsumerRequest, Get-vRAConsumerResource, Get-vRAConsumerResourceOperation, Get-vRAConsumerResourceType, Get-vRAConsumerService
Request-vRAConsumerCatalogItem
* Updated README.md to include more information regarting Core Support
Expand Down
14 changes: 6 additions & 8 deletions src/Functions/Public/Connect-vRAServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,11 @@
try {

# --- Create Invoke-RestMethod Parameters
$JSON = @"
{
"username":"$($Username)",
"password":"$($JSONPassword)",
"tenant":"$($Tenant)"
}
"@
$JSON = @{
username = $Username
password = $JSONPassword
tenant = $Tenant
} | ConvertTo-Json

$Params = @{

Expand Down Expand Up @@ -197,4 +195,4 @@

Write-Output $vRAConnection

}
}
118 changes: 118 additions & 0 deletions src/Functions/Public/catalog-service/Get-vRARequestDetail.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@

function Get-vRARequestDetail {
<#
.SYNOPSIS
Get detailed information about vRA request
.DESCRIPTION
Get detailed information about vRA request. These are result produced by the request (if any)
.PARAMETER Id
The Id of the request to query
.PARAMETER RequestNumber
The request number of the request to query
.INPUTS
System.String
.OUTPUTS
System.Management.Automation.PSObject
.EXAMPLE
Get-vRARequestDetail -Id 972ab103-950a-4240-8a3d-97174ee07f35
.EXAMPLE
Get-vRARequestDetail -RequestNumber 965299
.EXAMPLE
Get-vRARequestDetail -RequestNumber 965299,965300
.EXAMPLE
Get-vRARequest -RequestNumber 965299 | Get-vRARequestDetail
#>
[CmdletBinding(DefaultParameterSetName="ById")][OutputType('System.Management.Automation.PSObject', 'System.Object[]')]

Param (

[Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,ParameterSetName="ById")]
[ValidateNotNullOrEmpty()]
[String[]]$Id,

[Parameter(Mandatory=$true,ParameterSetName="ByRequestNumber")]
[ValidateNotNullOrEmpty()]
[String[]]$RequestNumber

)

Begin {

# --- Test for vRA API version
xRequires -Version 7.0

}

Process {

try {

switch ($PsCmdlet.ParameterSetName) {

# --- If the id parameter is passed returned detailed information about the request
'ById' {

foreach ($RequestId in $Id){

$RequestNumber = (Get-vRARequest -Id $RequestId).RequestNumber
$URI = "/catalog-service/api/consumer/requests/$($RequestId)/forms/details"
$RequestDetail = Invoke-vRARestMethod -Method GET -URI $URI -Verbose:$VerbosePreference

[PSCustomObject] @{

Id = $RequestId
RequestNumber = $RequestNumber
Detail = $RequestDetail.values.entries
}
}

break

}
# --- If the request number parameter is passed returned detailed information about the request
'ByRequestNumber' {

foreach ($Number in $RequestNumber){

$RequestId = (Get-vRARequest -RequestNumber $Number).id
$URI = "/catalog-service/api/consumer/requests/$($RequestId)/forms/details"
$RequestDetail = Invoke-vRARestMethod -Method GET -URI $URI -Verbose:$VerbosePreference

[PSCustomObject] @{

Id = $RequestId
RequestNumber = $Number
Detail = $RequestDetail.values.entries
}
}

break

}

}

}
catch [Exception]{

throw

}

}

End {

}

}
Loading

0 comments on commit 9d14291

Please sign in to comment.