PowerShell
PowerShell is an interactive Command-Line Interface (CLI) and automation engine designed by Microsoft to help design system configurations and automate administrative tasks. This tool has its own command-line with a unique programming language similar to Perl.
Usage:beskriver
PS .\getAnywhereVMRInfo.ps1 -username 'XXXX@api.anywhere.vc' -password 'XXXX' -vmrId 1234
---- VMR INFO ----
Name: Test VMR (DEMO)
HostPin: 1234
GuestPin: 4321
------------------
getAnywhereVMRInfo.ps1
param(
[string]$username,
[string]$password,
[int]$vmrId
)
Set-Variable -Name "body" -Value "grant_type=password&username=$username&password=$password"
$params = @{
Uri = 'https://admin.anywhere.vc/Token'
Method = 'POST'
Body = $body
}
$token = Invoke-RestMethod @params
$access_token = $token.access_token
$vmrparams = @{
Uri = "https://admin.anywhere.vc/api/client/v1/conference/$vmrId"
Headers = @{ 'Authorization' = "Bearer $access_token" }
Method = 'GET'
ContentType = 'application/json'
}
$vmrInfo = Invoke-RestMethod @vmrparams
echo "---- VMR INFO ----"
Write-Host "Name: " $vmrInfo.name
Write-Host "HostPin: " $vmrInfo.pin
Write-Host "GuestPin: " $vmrInfo.guestPin
echo "------------------"