microsoft / vssetup.powershell

PowerShell module to interact with Visual Studio Setup
MIT License
233 stars 41 forks source link

Support for -ComputerName for remote query of version #39

Closed gordonAndersen closed 6 years ago

gordonAndersen commented 6 years ago

It would be nice if one could do a Get-VSSetupInstance -ComputerName MyBuildserver. I have tried with something like Invoke-Command MyBuildserver -Scriptblock {Get-VSSetupInstance} without luck.

heaths commented 6 years ago

The APIs are not remotable, but you can create a WinRM session to a remote computer and install/execute the module on that remove computer.

$session = new-possession RemoteComputerName
invoke-command -session $session { if (!(get-module -list vssetup)) { install-module vssetup -scope currentuser }; get-vssetupinstance -all -pre }
$session | remove-possession