Collection of PowerShell Scripts created to interact to Rubrik CDM
MIT License
50
stars
58
forks
source link
Invoke-WebRequest : Cannot bind parameter 'Uri'. Cannot convert value "https:///api/internal/report/CustomReport:::1af913f6-6ad9-421b-bbf7-069a20e36a91/table" to type "System.Uri". Error: "Invalid URI: The hostname could not be parsed." #153
Import-Module Rubrik
$server = 'xxxx' $rubrik_user = 'admin' $rubrik_pass = 'xxxx' $baseURL = "https://" + $server + "/web/bin/index.html"
function Get-RubrikReportData41 () { [CmdletBinding()] Param ( [string]$server, [string]$rubrik_user, [string]$rubrik_pass, [string]$baseURL, [string]$report_id, [System.Object]$report_query )
using System.Net; using System.Security.Cryptography.X509Certificates; public class TrustAllCertsPolicy : ICertificatePolicy { public bool CheckValidationResult( ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem) { return true; } } "@ [System.Net.ServicePointManager]::CertificatePolicy = New-Object -TypeName TrustAllCertsPolicy
}
$report_query = @{
}
$report_id = 'CustomReport:::1af913f6-6ad9-421b-bbf7-069a20e36a91'
$a = Get-RubrikReportData41 -server $baseURL -rubrik_user $rubrik_user -rubrik_pass $rubrik_pass -report_query $report_query -report_id $report_id Write-Output ($a)
========================= I get the below error