rubrikinc / rubrik-sdk-for-powershell

Rubrik Module for PowerShell
https://build.rubrik.com/sdks/powershell/
MIT License
102 stars 86 forks source link

Getting below error while creating new SLA in Rubrik #765

Closed Nchinke closed 3 years ago

Nchinke commented 3 years ago

Hello team,

I have begun to explore the Rubrik Module in Powershell and am fairly new.

I am getting below error while trying to create new SLA: Command used: New-RubrikSLA -Name Test -DailyFrequency 1 -DailyRetention 7 -Verbose

Error encountered:

Invoke-WebRequest : Request malformed
At C:\Program Files (x86)\WindowsPowerShell\Modules\Rubrik\5.2.0\Private\Invoke-RubrikWebRequest.ps1:28 char:23
+ ...   $result = Invoke-WebRequest -UseBasicParsing -TimeoutSec $rubrikOpt ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

I am successfully able to connect to Rubrik Edge cluster.

Kindly suggest.

jaapbrasser commented 3 years ago

Hello @Nchinke,

Have you tried updating your module to the latest version, the payload was modified for newer versions of Rubrik CDM so the updated version of the module is required for this.

You can install the latest version it by running:

Install-Module Rubrik -Force -Scope CurrentUser
jaapbrasser commented 3 years ago

Let me know how that works for you and if that resolves your issue!

jaapbrasser commented 3 years ago

Marking this one as resolved for the time being, feel free to reopen it by commenting below if your issue isn't resolved.