PowerShell / WindowsCompatibility

Module that allows Windows PowerShell Modules to be used from PSCore6
Other
138 stars 33 forks source link

Support for non-Windows OS & target host in Environment variable #53

Open jhoneill opened 5 years ago

jhoneill commented 5 years ago

The changes I've made are to allow the module to run in PowerShell core 6.1 on non-Windows OSes - the original code wasn't designed to connect to an SSH session. The remote session is PowerShell core 6.1, and it is possible to load the module in that session, import a Windows PowerShell 5.1 module and then use Import-PSSession from Linux to access a 5.1 module with a "double hop".

I've tested the changes in the Linux subsystem on Window 10 only, and more extensive testing on "real" Linux and Mac would be ideal.

In some environments it would be useful to specify the Server hosting the compatibility session as an environment variable so I've added that.

The existing Pester tests pass on Windows; I haven't added any new tests.