Skip to content

Commit

Permalink
Merge branch 'master' into melliott-devel-224
Browse files Browse the repository at this point in the history
  • Loading branch information
jaapbrasser authored May 27, 2019
2 parents 2883b31 + f9c8ebb commit fb736ac
Show file tree
Hide file tree
Showing 17 changed files with 592 additions and 570 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

=======

## 2019-05-27

### Changed [Added functionality]

* Added -name parameter to Get-RubrikOrganization

## 2019-05-24

### Changed [Resolving issues]

* Updated Get-RubrikDatabase, Get-RubrikFileset, Get-RubrikHyperVVM, GetRubrikNutanixVM and Get-RubrikVolumeGroup to address issue [223](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/223). Calls to Test-RubrikSLA were inadvertently overwriting the $SLAID variable, causing the paramater to be ignored.
* Added Custom User Agent value to HTTP headers in Connect-Rubrik function

## 2019-05-22

### Changed [Resolving issues]
Expand Down
9 changes: 7 additions & 2 deletions Rubrik/Public/Connect-Rubrik.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ function Connect-Rubrik {

Process {

# Create User Agent string
$UserAgent = "Rubrik-Powershell-SDK/$($MyInvocation.MyCommand.ScriptBlock.Module.Version.ToString())"
Write-Verbose -Message "Using User Agent $($UserAgent)"

if($Token)
{
$head = @{'Authorization' = "Bearer $($Token)"}
$head = @{'Authorization' = "Bearer $($Token)";'User-Agent' = $UserAgent}
Write-Verbose -Message 'Storing all connection details into $global:rubrikConnection'
$global:rubrikConnection = @{
id = $null
Expand All @@ -122,6 +126,7 @@ function Connect-Rubrik {
$auth = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($Credential.UserName + ':' + $Credential.GetNetworkCredential().Password))
$head = @{
'Authorization' = "Basic $auth"
'User-Agent' = $UserAgent
}
$content = Submit-Request -uri $uri -header $head -method $($resources.Method)

Expand All @@ -131,7 +136,7 @@ function Connect-Rubrik {
}

# For API version v1 or greater, use Bearer and token
$head = @{'Authorization' = "Bearer $($content.token)"}
$head = @{'Authorization' = "Bearer $($content.token)";'User-Agent' = $UserAgent}

Write-Verbose -Message 'Storing all connection details into $global:rubrikConnection'
$global:rubrikConnection = @{
Expand Down
Loading

0 comments on commit fb736ac

Please sign in to comment.