PowerShell / VMware Sync (but with folders) / VMware Remote Console AddOn
Because your current VMware Synchronizer does not also import folder structure, I've resorted to writing my own sync in PowerShell. Does the standard one also use PowerShell? Can I customize it locally for my organization? Or, What code do you use to set the session with Type=Addon,Addon.Properties=<some crazy string>,ConnectionSubType=<some GUID>?
I've attached my script (I don't claim it's perfect), and a screenshot of the outcome compared to my vCenter.
More immediately, how can I use PowerShell to set a session that is the "VMware Remote Console" type (Line 37/38)? As mentioned above, I haven't figured out how your Addon.Properties value is encoded/decoded. Is it even possible to set a session of this type?
Lastly, Is there a better way to "check if session already exists, if true don't create it, else create it? Lines 35:40. New-RDMSession will create duplicates. And Get-RDMSession errors out no matter what you do (" | Out-Null" for example), so I've resorted to having to Try/Catch:
Try { Get-RDMSession -Name "X" -ErrorAction Continue } # See if the session already exists - will error if not
Catch { New-RDMSession -Name "X" -Type "X" -SetSession } # Did not exist - create a new session
Is there a better way? Can you improve this if not? Maybe another switch param on New-RDMSession to Overwrite? Have Set-RDMSession create if not exist, else overwrite?
VM Sync with Folders.png
Import-VMRC.ps1
Hello,
We are discussing implementing the feature to use the folder structure.
Helping you recreate all of the business logic behind our synchronizers using powershell is not optimal. I'd rather we spend some time testing out a proof of concept beforehand.
Best regards,
Maurice
Thanks, Maurice!
That sounds fine. The sync's are definitely cool, and I'd love to see them work to our needs!
In the meantime, is there a way to create a VMware Remote Console session via powershell? I guess that's the only missing piece for me right now.
-Steve
Found a solution within PowerShell -
Could you let me know when/if your out-of-the-box synchronizer can handle and create the folder-structure?
Thanks!