r/PowerShell • • May 21 '18

News Microsoft Replacing Windows with Linux for PowerShell in the Cloud

https://myitforum.com/microsoft-replacing-windows-with-linux-for-powershell-in-the-cloud/
161 Upvotes

81 comments sorted by

View all comments

Show parent comments

16

u/GLiMPSEiNATOR May 21 '18

Implicit remoting works in Powershell Core. Once I realized this, I really started to warm up to it.

You don’t need the cmdlets/modules installed on your endpoint... you just need them installed on an endpoint you can access :-)

14

u/zyeus-guy May 21 '18

I was just about to respond with exactly this comment...

In Microsoft defence, they have said “we didn’t make this well known enough” and have released a module which essentially makes this a snap.

Checkout Jeffrey Snover video from PS and DevOps 2018 video .

4

u/admiralspark May 22 '18

Do you have a link to the module possibly? I don't want to watch a 1.5hr presentation to find a module name to google...

9

u/ka-splam May 22 '18

AFAIK, implicit remoting doesn't need a module;

$s = new-pssession -computername yourDChere -credential (get-credential)
Import-Module -Name ActiveDirectory -PSSession $s

Get-AdComputer

It "imports" a module from another computer, creating proxy cmdlet wrappers locally which work more or less exactly like the real cmdlets, but they serialize stuff and send it over the network in the background.

That serializing to XML and back again step makes it not exactly like the originals - what you get back isn't quite the same "live" objects in the same way, but I think it's good enough for many use cases.

2

u/admiralspark May 22 '18

ohhhhhhhh you just mean pssessions. I was hoping for something new that might fix the weirdness that PSSession has.

5

u/ka-splam May 22 '18

I don't /just/ mean PS Sessions, I mean the ability to import a module from a remote session to a local session, then pretend it's a local module. But if that's what you mean, then yes I think so.

0

u/admiralspark May 22 '18

Right. I'm looking for something to run code remotely, like what Invoke-Command was supposed to do with the -scriptblock/-file or whatever tags. Unfortunately it doesn't handle stuff like local variables or stdout cleanly so it requires a bunch of hacks to get it working.

6

u/ka-splam May 22 '18

Is $using: not clean enough? Do you want it to somehow make your entire local computer's memory available remotely and automagically know which memory a variable is stored in or something?

→ More replies (0)