-
-
Save jonathanmedd/a28b1cbb6b7b071b9b1e3636f91d917e to your computer and use it in GitHub Desktop.
Get-vROWorkflow By Id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Credential = Get-Credential | |
$Username = $Credential.UserName | |
$Password = $Credential.GetNetworkCredential().Password | |
# --- Deal with certificate issues | |
# --- Note: this code will disable certificate checking | |
# --- for this PowerShell session | |
if (-not ("TrustAllCertsPolicy" -as [type])){ | |
Add-Type @" | |
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 TrustAllCertsPolicy | |
# --- Create REST Headers | |
$Auth = $Username + ':' + $Password | |
$Encoded = [System.Text.Encoding]::UTF8.GetBytes($Auth) | |
$EncodedPassword = [System.Convert]::ToBase64String($Encoded) | |
$Headers = @{"Authorization"="Basic $($EncodedPassword)";} | |
$Server = "vraap02.vrademo.local" | |
$WorkflowId = "f6dc3b0b-5c46-42ef-a8a0-9418fa49eb71" | |
$URI = "https://$($Server):8281/vco/api/workflows/$($WorkflowId)" | |
$Workflows = Invoke-RestMethod -Method Get -Uri $URI -Headers $Headers -ContentType "application/xml" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment