Permalink
Browse files

Merge to master for v1.4.0 (#79)

* Updates Get-vRACatalogItem with -ListAvailable, -Page & new pscustomobject layout

* Url encoding and pscusomobject arangement

* reworked added service, page uri encoding and pscusomobject order change

* Page support, pscusomobject change and added requestedBy and requestedFor'

* Tidied up Get-vRAService and added Get-vRAEntitledService to replace Get-vRAConsumerService

* Moved functions
=

* Created new function in to replace Get-vRAConsumerCatalogItemRequestTemplte

* Initial commit for Get-vRADeployment

* .length to .count

* .length to .count

* .length to .count

* New Get-vRAResource

* Initial commit for Get-vRAResourceAction in this branch

* Removed Get-vRADeployment

* Changed property name id to resource id

* Removed Alias

* Initial commit for Get-vRAREsourceActionRequestTemplate

* length to count

* Moved to catalog-service and cleaned up code.. adding suport for Paging

* Changes $EnvodedURI to $EscapedURI and updaed returned PSCustomObject

* Moved to catalog-service

* Moved to catalog-service

* Moved to catalog-service and cleaned code

* Changes $EncodedURI to $EscapedURI

* Changes $EncodedURI to $EscapedURI & code clean up

* Updated parametersets for actionid

* Moved to catalog-service

* Updates inputs in help

* Marks deprecated functions and removes old catalog functions

* Adds warning to deprecated functions

* Marked as deprecated

* Moves catalog-service to Functions\Public

* Moved and refactored

* functions moved to catalog-service

* Code clean up - ensure formatting and pipeline support

* Adds $VerbosePreference to invoke-vrarestmethod

* Adds support for filtering by state

* Add help text for Type parameter

* Add out-null for null response

* Updates help text to remove Consumer

* fixes issue #55

* Fixes issue #63

* Fixes issue where nested modules was being wiped when the function was invoked

* Removed Test task from Release

* Adds xRequires to functions

* Fixes issue #65

* Removes , breaking build script

* Updates documentation with catalog-service changes

* Bump Module Version to 1.4.0

* Fixes incorrect parameter for Get-vRAResourceActionRequestTemplate

* Changes ConfirmImpact="Low" to ConfirmImpact="High"

* Build improvements

* Build script improvements

* Updated documents via build.ps1

* Feature ps call stack impl (#69)

* Removes -Context and adds support for PSCallStack in xRequires

* Removes -Context

* Removes -Conext / tested function

* Fixes issue where missing tenant name causes function to fail

* Adds exclusion for Variables.json

* Catalog-Service Tests

* Update gitignore

* untracks variables.json so it is ignored

* By moving to a PSScriptAnalyzerSettings file, we will no longer get the emailed errors from the PowerShell Gallery (#71)

* By moving to a PSScriptAnalyzerSettings file, we will no longer get the emailed errors from the PowerShell Gallery

* Move to root directory

* Modify build directly

* Added Requires Version 5

* Added fix to ensure that script analyzer doesn't see variables as un assigned

* Changes the way documentation is generated

* Fixed function duplication

* Moves UpdateModuleManifest into build

* PlatyPS integration

* Set correct docs folder

* add test task to release

* Removes files that are no longer required

* Changes location

* Adds PowervRA-icon.png to repo

* Removes unneeded lines from build.ps1

* Combine build helpers in to build.psake.ps1

* Update build.settings.ps1

* updated module manifest

* Adds section to ensure index.md always reflects README.md

* Docs generated by PlatyPS

* Adds -NoMetadata switch to New-MarkdownHelp

* Rebuilt docs with no metadata at the top of the files

* Adds ValidateSet to task parameter and a help section describing the build the purpose of the script

* Updates how ScriptAnalyzer results are displayed

* Changes Severity to include Warnings and Errors - build is set to only fail when errors are detected

* Fixes issue #73 and updates associated files with correct version number

* Feature networkprofiles (#74)

* Initial draft for network-profile support

* removed hidden param

* Continuing with network profile dev.. found bugs in api

* Initial draft for network-profile support

* removed hidden param

* Continuing with network profile dev.. found bugs in api

* Migrates networkprofile commands to Functions\Public\iaas-proxy-provider

* Cleans up code

* initial commit

* Network Profile Dev

* Splitting out Network profile functions for each type of profile..

* More separation work..

* Help cleanup

* Network profile prep

* Typo in filename

* Placeholder

* Initial commit for Get-vRANetworkProfileAddressList

* Initial commit for Get-vRANetworkProfileIPRangeSummary

* Fix typo in function name

* Add xRequires -Version 7.1

* Remove IPranges support for Routed network profiles

* Updates examples

* Remove unused variable

* VerbosePreference

* Adds ShouldProcess

* Cleanup - Remove name and extra code

* tweeks

* Removal of stalte parameter sets and cleanup

* Tests template

* Re add missing }

* Updates test template

* Replaces DefaultParameterSet

* Addresses issue #75

* Updates parameter sets

* Adds network profile support to manifest

* Docs update

* Initial commit for appveyor.yml

* build settings

* Update

* adds version option

* Out-Null

* Adds build status badge

* Adds new files to gitattributes

* lowercase

* Updates help

* Updates helo

* fixes incorrect command being called

* Adds initial pester tests for network profiles

* Adds ipranges param and updates help

* Updated docs

* Limits the branches that appveyor will build

* Moved Variables.json example into the tests\data folder

* Updates variables example to support catalog-service

* Remove old variable dependencies

* Fixes issue highlighted by tests

* Removes redundant tests

* Updated Readme with support info for 7.1
  • Loading branch information...
1 parent e045a07 commit c05e75235373834fa48c9d9c3fc318f8a47e3ca4 @chelnak chelnak committed with jonathanmedd Nov 30, 2016
Showing with 18,528 additions and 7,278 deletions.
  1. +6 −0 .gitattributes
  2. +3 −1 .gitignore
  3. +4 −0 PSScriptAnalyzerSettings.psd1
  4. BIN PowervRA-icon.png
  5. +22 −10 PowervRA/Functions/Private/xRequires.ps1
  6. +1 −1 PowervRA/Functions/Public/Export-vRAContentPackage.psm1
  7. +3 −2 PowervRA/Functions/Public/Get-vRABlueprint.psm1
  8. +2 −1 PowervRA/Functions/Public/Get-vRABusinessGroup.psm1
  9. +0 −202 PowervRA/Functions/Public/Get-vRACatalogItem.psm1
  10. +0 −123 PowervRA/Functions/Public/Get-vRACatalogPrincipal.psm1
  11. +3 −2 PowervRA/Functions/Public/Get-vRAContentPackage.psm1
  12. +0 −196 PowervRA/Functions/Public/Get-vRAEntitledCatalogItem.psm1
  13. +0 −186 PowervRA/Functions/Public/Get-vRAEntitlement.psm1
  14. +1 −1 PowervRA/Functions/Public/Get-vRAReservationComputeResourceMemory.psm1
  15. +3 −2 PowervRA/Functions/Public/Get-vRAResourceMetric.psm1
  16. +0 −248 PowervRA/Functions/Public/Get-vRAResourceOperation.psm1
  17. +0 −183 PowervRA/Functions/Public/Get-vRAResourceType.psm1
  18. +0 −185 PowervRA/Functions/Public/Get-vRAService.psm1
  19. +3 −2 PowervRA/Functions/Public/Get-vRATenantDirectoryStatus.psm1
  20. +1 −1 PowervRA/Functions/Public/Get-vRAUserPrincipal.psm1
  21. +3 −3 PowervRA/Functions/Public/New-vRABusinessGroup.psm1
  22. +1 −1 PowervRA/Functions/Public/New-vRAContentPackage.psm1
  23. +1 −1 PowervRA/Functions/Public/New-vRAReservation.psm1
  24. +1 −1 PowervRA/Functions/Public/New-vRAUserPrincipal.psm1
  25. +1 −1 PowervRA/Functions/Public/Remove-vRABusinessGroup.psm1
  26. +1 −1 PowervRA/Functions/Public/Remove-vRAContentPackage.psm1
  27. +1 −1 PowervRA/Functions/Public/Remove-vRAUserPrincipal.psm1
  28. +1 −1 PowervRA/Functions/Public/Set-vRABusinessGroup.psm1
  29. +1 −1 PowervRA/Functions/Public/Set-vRATenantDirectory.psm1
  30. +1 −1 PowervRA/Functions/Public/Set-vRAUserPrincipal.psm1
  31. +2 −0 ...ic/{Get-vRAConsumerCatalogItem.psm1 → catalog-service/DEPRECATED-Get-vRAConsumerCatalogItem.psm1}
  32. +5 −1 ...RequestTemplate.psm1 → catalog-service/DEPRECATED-Get-vRAConsumerCatalogItemRequestTemplate.psm1}
  33. +2 −0 ...merEntitledCatalogItem.psm1 → catalog-service/DEPRECATED-Get-vRAConsumerEntitledCatalogItem.psm1}
  34. +2 −0 ...ons/Public/{Get-vRAConsumerRequest.psm1 → catalog-service/DEPRECATED-Get-vRAConsumerRequest.psm1}
  35. +5 −2 ...s/Public/{Get-vRAConsumerResource.psm1 → catalog-service/DEPRECATED-Get-vRAConsumerResource.psm1}
  36. +2 −0 ...onsumerResourceOperation.psm1 → catalog-service/DEPRECATED-Get-vRAConsumerResourceOperation.psm1}
  37. +3 −1 .../{Get-vRAConsumerResourceType.psm1 → catalog-service/DEPRECATED-Get-vRAConsumerResourceType.psm1}
  38. +3 −1 ...ons/Public/{Get-vRAConsumerService.psm1 → catalog-service/DEPRECATED-Get-vRAConsumerService.psm1}
  39. +4 −1 ...est-vRAConsumerCatalogItem.psm1 → catalog-service/DEPRECATED-Request-vRAConsumerCatalogItem.psm1}
  40. +231 −0 PowervRA/Functions/Public/catalog-service/Get-vRACatalogItem.psm1
  41. +106 −0 PowervRA/Functions/Public/catalog-service/Get-vRACatalogItemRequestTemplate.psm1
  42. +132 −0 PowervRA/Functions/Public/catalog-service/Get-vRACatalogPrincipal.psm1
  43. +239 −0 PowervRA/Functions/Public/catalog-service/Get-vRAEntitledCatalogItem.psm1
  44. +203 −0 PowervRA/Functions/Public/catalog-service/Get-vRAEntitledService.psm1
  45. +207 −0 PowervRA/Functions/Public/catalog-service/Get-vRAEntitlement.psm1
  46. +353 −0 PowervRA/Functions/Public/catalog-service/Get-vRARequest.psm1
  47. +300 −0 PowervRA/Functions/Public/catalog-service/Get-vRAResource.psm1
  48. +92 −0 PowervRA/Functions/Public/catalog-service/Get-vRAResourceAction.psm1
  49. +119 −0 PowervRA/Functions/Public/catalog-service/Get-vRAResourceActionRequestTemplate.psm1
  50. +213 −0 PowervRA/Functions/Public/catalog-service/Get-vRAResourceOperation.psm1
  51. +213 −0 PowervRA/Functions/Public/catalog-service/Get-vRAResourceType.psm1
  52. +203 −0 PowervRA/Functions/Public/catalog-service/Get-vRAService.psm1
  53. +42 −52 PowervRA/Functions/Public/{ → catalog-service}/New-vRAEntitlement.psm1
  54. +31 −33 PowervRA/Functions/Public/{ → catalog-service}/New-vRAService.psm1
  55. +19 −13 PowervRA/Functions/Public/{ → catalog-service}/Remove-vRAService.psm1
  56. +197 −0 PowervRA/Functions/Public/catalog-service/Request-vRACatalogItem.psm1
  57. +141 −0 PowervRA/Functions/Public/catalog-service/Request-vRAResourceAction.psm1
  58. +27 −25 PowervRA/Functions/Public/{ → catalog-service}/Set-vRACatalogItem.psm1
  59. +40 −42 PowervRA/Functions/Public/{ → catalog-service}/Set-vRAEntitlement.psm1
  60. +30 −28 PowervRA/Functions/Public/{ → catalog-service}/Set-vRAService.psm1
  61. +241 −0 PowervRA/Functions/Public/iaas-proxy-provider/Get-vRAExternalNetworkProfile.psm1
  62. +253 −0 PowervRA/Functions/Public/iaas-proxy-provider/Get-vRANATNetworkProfile.psm1
  63. +84 −0 PowervRA/Functions/Public/iaas-proxy-provider/Get-vRANetworkProfileIPAddressList.psm1
  64. +90 −0 PowervRA/Functions/Public/iaas-proxy-provider/Get-vRANetworkProfileIPRangeSummary.psm1
  65. +243 −0 PowervRA/Functions/Public/iaas-proxy-provider/Get-vRARoutedNetworkProfile.psm1
  66. +171 −0 PowervRA/Functions/Public/iaas-proxy-provider/New-vRAExternalNetworkProfile.psm1
  67. +307 −0 PowervRA/Functions/Public/iaas-proxy-provider/New-vRANATNetworkProfile.psm1
  68. +74 −0 PowervRA/Functions/Public/iaas-proxy-provider/New-vRANetworkProfileIPRangeDefinition.psm1
  69. +262 −0 PowervRA/Functions/Public/iaas-proxy-provider/New-vRARoutedNetworkProfile.psm1
  70. +70 −0 PowervRA/Functions/Public/iaas-proxy-provider/Remove-vRAExternalNetworkProfile.psm1
  71. +70 −0 PowervRA/Functions/Public/iaas-proxy-provider/Remove-vRANATNetworkProfile.psm1
  72. +70 −0 PowervRA/Functions/Public/iaas-proxy-provider/Remove-vRARoutedNetworkProfile.psm1
  73. +203 −0 PowervRA/Functions/Public/iaas-proxy-provider/Set-vRAExternalNetworkProfile.psm1
  74. +352 −0 PowervRA/Functions/Public/iaas-proxy-provider/Set-vRANATNetworkProfile.psm1
  75. +203 −0 PowervRA/Functions/Public/iaas-proxy-provider/Set-vRARoutedNetworkProfile.psm1
  76. BIN PowervRA/PowervRA.psd1
  77. +3 −1 README.md
  78. +13 −0 appveyor.yml
  79. +0 −147 bin/DocumentTemplates/md-function-template.ps1
  80. +0 −16 bin/DocumentTemplates/mkdocs-yml-template.ps1
  81. +0 −64 bin/Update-MKDocsYML.psm1
  82. +0 −78 bin/Update-ModuleDocumentation.psm1
  83. +0 −85 bin/Update-ModuleManifestFunctions.psm1
  84. +0 −146 bin/Update-ModuleManifestVersion.psm1
  85. +0 −105 bin/psake.build.ps1
  86. +52 −88 build.ps1
  87. +265 −0 build.psake.ps1
  88. +69 −0 build.settings.ps1
  89. +79 −45 docs/Add-vRAPrincipalToTenantRole.md
  90. +76 −37 docs/Add-vRAReservationNetwork.md
  91. +88 −42 docs/Add-vRAReservationStorage.md
  92. +94 −51 docs/Connect-vRAServer.md
  93. +42 −22 docs/Disconnect-vRAServer.md
  94. +71 −54 docs/Export-vRAContentPackage.md
  95. +50 −40 docs/Get-vRAApplianceServiceStatus.md
  96. +44 −31 docs/Get-vRAAuthorizationRole.md
  97. +70 −44 docs/Get-vRABlueprint.md
  98. +55 −36 docs/Get-vRABusinessGroup.md
  99. +106 −46 docs/Get-vRACatalogItem.md
  100. +91 −0 docs/Get-vRACatalogItemRequestTemplate.md
  101. +39 −45 docs/Get-vRACatalogPrincipal.md
  102. +76 −53 docs/Get-vRAConsumerCatalogItem.md
  103. +78 −60 docs/Get-vRAConsumerCatalogItemRequestTemplate.md
  104. +79 −55 docs/Get-vRAConsumerEntitledCatalogItem.md
  105. +88 −59 docs/Get-vRAConsumerRequest.md
  106. +103 −72 docs/Get-vRAConsumerResource.md
  107. +29 −18 docs/Get-vRAConsumerResourceOperation.md
  108. +72 −45 docs/Get-vRAConsumerResourceType.md
  109. +73 −46 docs/Get-vRAConsumerService.md
  110. +70 −44 docs/Get-vRAContentPackage.md
  111. +109 −49 docs/Get-vRAEntitledCatalogItem.md
  112. +121 −0 docs/Get-vRAEntitledService.md
  113. +84 −41 docs/Get-vRAEntitlement.md
  114. +119 −0 docs/Get-vRAExternalNetworkProfile.md
  115. +66 −45 docs/Get-vRAGroupPrincipal.md
  116. +119 −0 docs/Get-vRANATNetworkProfile.md
  117. +88 −0 docs/Get-vRANetworkProfileIPAddressList.md
  118. +88 −0 docs/Get-vRANetworkProfileIPRangeSummary.md
  119. +218 −0 docs/Get-vRARequest.md
  120. +84 −51 docs/Get-vRAReservation.md
  121. +69 −44 docs/Get-vRAReservationComputeResource.md
  122. +38 −21 docs/Get-vRAReservationComputeResourceMemory.md
  123. +60 −35 docs/Get-vRAReservationComputeResourceNetwork.md
  124. +60 −35 docs/Get-vRAReservationComputeResourceResourcePool.md
  125. +60 −35 docs/Get-vRAReservationComputeResourceStorage.md
  126. +70 −44 docs/Get-vRAReservationPolicy.md
  127. +48 −39 docs/Get-vRAReservationTemplate.md
  128. +84 −51 docs/Get-vRAReservationType.md
  129. +197 −0 docs/Get-vRAResource.md
  130. +55 −0 docs/Get-vRAResourceAction.md
  131. +91 −0 docs/Get-vRAResourceActionRequestTemplate.md
  132. +74 −52 docs/Get-vRAResourceMetric.md
  133. +89 −60 docs/Get-vRAResourceOperation.md
  134. +85 −42 docs/Get-vRAResourceType.md
  135. +119 −0 docs/Get-vRARoutedNetworkProfile.md
  136. +87 −44 docs/Get-vRAService.md
  137. +70 −44 docs/Get-vRAServiceBlueprint.md
  138. +70 −44 docs/Get-vRAStorageReservationPolicy.md
  139. +45 −31 docs/Get-vRATenant.md
  140. +44 −31 docs/Get-vRATenantDirectory.md
  141. +42 −30 docs/Get-vRATenantDirectoryStatus.md
  142. +50 −27 docs/Get-vRATenantRole.md
  143. +86 −67 docs/Get-vRAUserPrincipal.md
  144. +18 −9 docs/Get-vRAVersion.md
  145. +69 −41 docs/Import-vRAContentPackage.md
  146. +91 −59 docs/Invoke-vRARestMethod.md
  147. +208 −130 docs/New-vRABusinessGroup.md
  148. +124 −72 docs/New-vRAContentPackage.md
  149. +177 −106 docs/New-vRAEntitlement.md
  150. +239 −0 docs/New-vRAExternalNetworkProfile.md
  151. +109 −64 docs/New-vRAGroupPrincipal.md
  152. +357 −0 docs/New-vRANATNetworkProfile.md
  153. +127 −0 docs/New-vRANetworkProfileIPRangeDefinition.md
  154. +328 −166 docs/New-vRAReservation.md
  155. +66 −35 docs/New-vRAReservationNetworkDefinition.md
  156. +92 −53 docs/New-vRAReservationPolicy.md
  157. +80 −40 docs/New-vRAReservationStorageDefinition.md
  158. +307 −0 docs/New-vRARoutedNetworkProfile.md
  159. +138 −90 docs/New-vRAService.md
  160. +92 −53 docs/New-vRAStorageReservationPolicy.md
  161. +130 −72 docs/New-vRATenant.md
  162. +303 −155 docs/New-vRATenantDirectory.md
  163. +176 −94 docs/New-vRAUserPrincipal.md
  164. +89 −54 docs/Remove-vRABusinessGroup.md
  165. +77 −48 docs/Remove-vRAContentPackage.md
  166. +84 −0 docs/Remove-vRAExternalNetworkProfile.md
  167. +67 −40 docs/Remove-vRAGroupPrincipal.md
  168. +84 −0 docs/Remove-vRANATNetworkProfile.md
  169. +79 −45 docs/Remove-vRAPrincipalFromTenantRole.md
  170. +77 −46 docs/Remove-vRAReservation.md
  171. +78 −49 docs/Remove-vRAReservationPolicy.md
  172. +84 −0 docs/Remove-vRARoutedNetworkProfile.md
  173. +60 −43 docs/Remove-vRAService.md
  174. +78 −49 docs/Remove-vRAStorageReservationPolicy.md
  175. +56 −35 docs/Remove-vRATenant.md
  176. +69 −42 docs/Remove-vRATenantDirectory.md
  177. +67 −40 docs/Remove-vRAUserPrincipal.md
  178. +195 −0 docs/Request-vRACatalogItem.md
  179. +144 −91 docs/Request-vRAConsumerCatalogItem.md
  180. +169 −0 docs/Request-vRAResourceAction.md
  181. +156 −93 docs/Set-vRABusinessGroup.md
  182. +123 −78 docs/Set-vRACatalogItem.md
  183. +144 −82 docs/Set-vRAEntitlement.md
  184. +209 −0 docs/Set-vRAExternalNetworkProfile.md
  185. +304 −0 docs/Set-vRANATNetworkProfile.md
  186. +228 −112 docs/Set-vRAReservation.md
  187. +76 −37 docs/Set-vRAReservationNetwork.md
  188. +125 −73 docs/Set-vRAReservationPolicy.md
  189. +98 −47 docs/Set-vRAReservationStorage.md
  190. +209 −0 docs/Set-vRARoutedNetworkProfile.md
  191. +139 −103 docs/Set-vRAService.md
  192. +125 −73 docs/Set-vRAStorageReservationPolicy.md
  193. +118 −67 docs/Set-vRATenant.md
  194. +301 −154 docs/Set-vRATenantDirectory.md
  195. +156 −93 docs/Set-vRAUserPrincipal.md
  196. +56 −35 docs/Test-vRAContentPackage.md
  197. +4 −2 docs/index.md
  198. BIN mkdocs.yml
  199. +1 −1 tests/Test000-Module.Tests.ps1
  200. +247 −0 tests/Test005-Catalog-Service.Tests.ps1
  201. +0 −65 tests/Test005-ServiceAndEntitlement.Tests.ps1
  202. +0 −85 tests/Test009-CatalogItem.Tests.ps1
  203. 0 tests/{Test010-Principal.Tests.ps1 → Test009-Principal.Tests.ps1}
  204. +211 −0 tests/Test010-IaaS-Proxy-Provider.Tests.ps1
  205. +0 −30 tests/Test099-Misc.Tests.ps1
  206. +23 −33 tests/{ → data}/Variables.json
View
@@ -3,5 +3,11 @@ tests/ export-ignore
README.md export-ignore
mkdocs.yml export-ignore
Get-PowervRA.ps1 export-ignore
+appveyor.yml export-ignore
+build.ps1 export-ignore
+build.psake.ps1 export-ignore
+build.settings.ps1 export-ignore
+PowervRA-icon.png export-ignore
+PSScriptAnalyzerSettings.psd1 export-ignore
.gitignore export-ignore
.gitattributes export-ignore
View
@@ -1 +1,3 @@
-Utils/
+Utils/
+tests/*.json
+
@@ -0,0 +1,4 @@
+@{
+ ExcludeRules=@("PSAvoidUsingUserNameAndPassWordParams","PSAvoidGlobalVars")
+ Severity=@("Warning","Error")
+}
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -7,10 +7,15 @@ function Global:xRequires {
Checks the required API Version for the current function
.PARAMETER Version
- The API Version that the function supports
+ The API Version that the function supports.
- .PARAMETER Context
- The functions execution context. This should always be $MyInvocation
+ The version number passed to this parameter must be in the following format.. it can't be a single character.
+
+ - 6.2.4
+ - 7.0
+ - 7.0.1
+ - 7.1
+ - 7.2
.INPUTS
System.Int
@@ -24,7 +29,7 @@ function Global:xRequires {
function Get-Example {
# This function does not support API versions lower than Version 7
- xRequires -Version 7 -Context $MyInvocation
+ xRequires -Version "7.0"
}
@@ -35,10 +40,7 @@ function Global:xRequires {
Param (
[Parameter(Mandatory=$true)]
- [Int]$Version,
-
- [Parameter(Mandatory=$true)]
- [PSCustomobject]$Context
+ [String]$Version
)
# --- Test for vRA API version
@@ -47,8 +49,18 @@ function Global:xRequires {
throw "vRA Connection variable does not exist. Please run Connect-vRAServer first to create it"
}
- elseif ($Global:vRAConnection.APIVersion -lt $Version) {
+ # --- Convert version strings to [version] objects
+ $APIVersion = [version]$Global:vRAConnection.APIVersion
+ $RequiredVersion = [version]$Version
+
+ if ($APIVersion -lt $RequiredVersion) {
+
+ $PSCallStack = Get-PSCallStack
+
+ throw "$($PSCallStack[1].Command) is not supported with vRA API version $($Global:vRAConnection.APIVersion)"
- throw "$($Context.MyCommand) is not supported with vRA API version $($Global:vRAConnection.APIVersion)"
}
+
+
+
}
@@ -56,7 +56,7 @@
Begin {
# --- Test for vRA API version
- xRequires -Version 7 -Context $MyInvocation
+ xRequires -Version 7.0
function internalWorkings ($InternalContentPackage, $InternalId, $InternalPath) {
@@ -46,8 +46,9 @@
[ValidateNotNullOrEmpty()]
[String]$Limit = "100"
)
-# --- Test for vRA API version
-xRequires -Version 7 -Context $MyInvocation
+
+ # --- Test for vRA API version
+ xRequires -Version 7.0
try {
switch ($PsCmdlet.ParameterSetName)
@@ -43,8 +43,9 @@
[ValidateNotNullOrEmpty()]
[String]$Limit = "100"
)
+
# --- Test for vRA API version
-xRequires -Version 7 -Context $MyInvocation
+xRequires -Version 7.0
try {
@@ -1,202 +0,0 @@
-function Get-vRACatalogItem {
-<#
- .SYNOPSIS
- Get a catalog item that the user is allowed to review.
-
- .DESCRIPTION
- API for catalog items that a system administrator can interact with. It allows the user to interact
- with catalog items that the user is permitted to review, even if they were not published or entitled to them.
-
- .PARAMETER Id
- The id of the catalog item
-
- .PARAMETER Name
- The name of the catalog item
-
- .PARAMETER Limit
- The number of entries returned per page from the API. This has a default value of 100.
-
- .INPUTS
- System.String
-
- .OUTPUTS
- System.Management.Automation.PSObject
-
- .EXAMPLE
- Get-vRACatalogItem
-
- .EXAMPLE
- Get-vRACatalogItem -Limit 9999
-
- .EXAMPLE
- Get-vRACatalogItem -Id dab4e578-57c5-4a30-b3b7-2a5cefa52e9e
-
- .EXAMPLE
- Get-vRACatalogItem -Name Centos_Template
-
-#>
-[CmdletBinding(DefaultParameterSetName="Standard")][OutputType('System.Management.Automation.PSObject')]
-
- Param (
-
- [parameter(Mandatory=$true,ValueFromPipeline=$false,ParameterSetName="ById")]
- [ValidateNotNullOrEmpty()]
- [String[]]$Id,
-
- [parameter(Mandatory=$true,ValueFromPipeline=$false,ParameterSetName="ByName")]
- [ValidateNotNullOrEmpty()]
- [String[]]$Name,
-
- [parameter(Mandatory=$false,ValueFromPipeline=$false)]
- [ValidateNotNullOrEmpty()]
- [String]$Limit = "100"
-
- )
-
- try {
-
- switch ($PsCmdlet.ParameterSetName) {
-
- # --- Get catalog item by id
- 'ById' {
-
- foreach ($CatalogItemId in $Id) {
-
- $URI = "/catalog-service/api/catalogItems/$($CatalogItemId)"
-
- Write-Verbose -Message "Preparing GET to $($URI)"
-
- $Response = Invoke-vRARestMethod -Method GET -URI $URI
-
- Write-Verbose -Message "SUCCESS"
-
- [pscustomobject] @{
-
- Callbacks = $Response.callbacks
- CatalogItemTypeRef = $Response.catalogItemTypeRef
- DateCreated = $Response.dateCreated
- Description = $Response.description
- Forms = $Response.forms
- IconId = $Response.iconId
- Id = $Response.id
- IsNoteworthy = $Response.isNoteworthy
- LastUpdatedDate = $Response.lastUpdatedDate
- Name = $Response.name
- Organization = $Response.organization
- OutputResourceTypeRef = $Response.outputResourceTypeRef
- ProviderBinding = $Response.providerBinding
- ServiceRef = $Response.serviceRef
- Status = $Response.status
- StatusName = $Response.statusName
- Quota = $Response.quota
- Version = $Response.version
- Requestable = $Response.requestable
-
- }
- }
-
- break
-
- }
- # --- Get catalog item by name
- 'ByName' {
-
- foreach ($CatalogItemName in $Name) {
-
- $URI = "/catalog-service/api/catalogItems?`$filter=name%20eq%20'$($CatalogItemName)'"
-
- Write-Verbose -Message "Preparing GET to $($URI)"
-
- $Response = Invoke-vRARestMethod -Method GET -URI "$($URI)"
-
- Write-Verbose -Message "SUCCESS"
-
- if ($Response.content.Length -eq 0) {
-
- throw "Could not find catalog item with name: $($CatalogItemName)"
-
- }
-
- [pscustomobject] @{
-
- Callbacks = $Response.content.callbacks
- CatalogItemTypeRef = $Response.content.catalogItemTypeRef
- DateCreated = $Response.content.dateCreated
- Description = $Response.content.description
- Forms = $Response.content.forms
- IconId = $Response.content.iconId
- Id = $Response.content.id
- IsNoteworthy = $Response.content.isNoteworthy
- LastUpdatedDate = $Response.content.lastUpdatedDate
- Name = $Response.content.name
- Organization = $Response.content.organization
- OutputResourceTypeRef = $Response.content.outputResourceTypeRef
- ProviderBinding = $Response.content.providerBinding
- ServiceRef = $Response.content.serviceRef
- Status = $Response.content.status
- StatusName = $Response.content.statusName
- Quota = $Response.content.quota
- Version = $Response.content.version
- Requestable = $Response.content.requestable
-
- }
-
- }
-
- break
-
- }
- # --- No parameters passed so return all catalog items
- 'Standard' {
-
- $URI = "/catalog-service/api/catalogItems?limit=$($Limit)&`$orderby=name%20asc"
-
- Write-Verbose -Message "Preparing GET to $($URI)"
-
- $Response = Invoke-vRARestMethod -Method GET -URI $URI
-
- Write-Verbose -Message "SUCCESS"
-
- Write-Verbose -Message "Response contains $($Response.content.Length) records"
-
- foreach ($CatalogItem in $Response.content) {
-
- [pscustomobject] @{
-
- Callbacks = $CatalogItem.callbacks
- CatalogItemTypeRef = $CatalogItem.catalogItemTypeRef
- DateCreated = $CatalogItem.dateCreated
- Description = $CatalogItem.description
- Forms = $CatalogItem.forms
- IconId = $CatalogItem.iconId
- Id = $CatalogItem.id
- IsNoteworthy = $CatalogItem.isNoteworthy
- LastUpdatedDate = $CatalogItem.lastUpdatedDate
- Name = $CatalogItem.name
- Organization = $CatalogItem.organization
- OutputResourceTypeRef = $CatalogItem.outputResourceTypeRef
- ProviderBinding = $CatalogItem.providerBinding
- ServiceRef = $CatalogItem.serviceRef
- Status = $CatalogItem.status
- StatusName = $CatalogItem.statusName
- Quota = $CatalogItem.quota
- Version = $CatalogItem.version
- Requestable = $CatalogItem.requestable
-
- }
-
- }
-
- break
-
- }
-
- }
-
- }
- catch [Exception]{
-
- throw
-
- }
-}
Oops, something went wrong.

0 comments on commit c05e752

Please sign in to comment.