Skip to content

Commit

Permalink
Merge pull request #630 from rubrikinc/jaap-627
Browse files Browse the repository at this point in the history
Export-RubrikVM - Illegal request in Invoke-RubrikWebRequest - Fix #627
  • Loading branch information
mwpreston authored May 27, 2020
2 parents f42972f + 1117798 commit acf5fc2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed

* `New-URIString` private function now validates `$id` input [Issue 627](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/627)
* Changed how `Set-RubrikNASShare` creates the body object [Issue 614](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/614) and added new unit tests for this function
* Modified `Set-RubrikAvailabilityGroup` and made `-LogRetentionHours` parameters mandatory while removing default value of -1
* Modified private function `Set-ObjectTypeName.ps1` to support the new `ApplyCustomViewDefinitions`.
Expand Down
7 changes: 7 additions & 0 deletions Rubrik/Private/New-URIString.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
An id value to be planted into the path or optionally at the end of the URI to retrieve a single object
#>

# Validation of id param
if ($id -match '^@\{') {
Write-Error -Message "Please validate ID input, please only input the ID parameter the object: '$id'" -ErrorAction Stop
} elseif ($id.Length -gt 100) {
Write-Error -Message "Please validate ID input, invalid ID provided: '$id'" -ErrorAction Stop
}

Write-Verbose -Message 'Build the URI'
# If we find {id} in the path, replace it with the $id value
if ($endpoint.Contains('{id}')) {
Expand Down

0 comments on commit acf5fc2

Please sign in to comment.