Forum / Remote Desktop Manager - Feature Request

Powershell : execute temporary sessions using Open-RDMQuickConnect

  • Create an Issue
  • Cancel

I have been using Open-RDMQuickConnect in a lot of my macros and was looking to add additional parameters. I have been doing this using templates but had a thought that allowing it to dynamically build the session in PowerShell would allow me a lot more granular control of how to display the information. For example, I have a PowerShell macro that executes performance counters against a remote system. It then analyzes the performance metrics, applies thresholds, and provides an HTML report using Open-RDMQuickConnect to embed the report in the RDM UI.

Example 1:
.\script.ps1
$URL = [system.Uri]$global:oPal.ArgsProcessed.HtmlOutputFileName | Select-Object AbsoluteUri -ExpandProperty AbsoluteUri
[System.String]$Template = (Get-RDMTemplate | Where-Object { $_.Name -eq 'HTML Report Viewer' } | Select-Object ID -ExpandProperty ID)

Open-RDMQuickConnect -Host $URL -TemplateID $Template


Example 2:
.\script.ps1
Copy-Item (Get-ChildItem '\\$PARENT_IP$\c$\PerfLogs\perfmon.blg') -Destination $env:temp\$PARENT_NAME$.blg -Force

[System.String]$Template = (Get-RDMTemplate | Where-Object { $_.Name -eq 'External Command' } | Select-Object ID -ExpandProperty ID)
Open-RDMQuickConnect -Host "$env:TEMP\$PARENT_NAME$.blg" -TemplateID $Template

.
This actually works very well... except the quick connect cmdlet only has a small number of parameters available I can use (Host, Template, etc.). I'm limited to what I statically defined in the template.
.
Example enhancement:
.\script.ps1
$Session = New-RDMSession -Name $scriptvar -Type $scriptvar1
$session.element1 = $scriptvar1

$session.element2 = $scriptvar2


$session.element3 = $scriptvar3

$etc.etc.etc
Open-RDMQuickConnect -Session $Session
.
Notice that I never actually save the New-RDMSession. Since the data processed by the script is different for every asset I run against, I could... say change the tab color to red for a perfmon counter that is over threshold. Really, the options are endless at that point.

Clock11 mths

Hi,
I will check with Olivier on how this would be hard to implement and add it to our todo list.

Regards

David Hervieux

signaturesignature

Clock11 mths