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

38

u/tier1throughinfinity May 21 '18

Makes sense since PS Core is in active development whereas WinPS will only receive security updates.

53

u/da_chicken May 21 '18

Yeah, but there's so much functionality missing from .Net Core that PowerShell Core 6 feels quite neutered. PowerShell Core 6 is fine from a shell or language perspective, but as a tool to manage applications shipped by Microsoft -- which is what PowerShell has become -- it's really kind of shit. I don't understand why Microsoft thinks we're not going to complain or be upset that they removed a bunch of features because it "aligns with their corporate strategy." PowerShell Core still feels to me like a stub language. It feels like how PowerShell 1.0 felt when it was released. Except now it's like Python 2 and Python 3, but back when everything was still written for Python 2.

I use PowerShell because I want the ActiveDirectory module, the SqlServer module, DSC, etc. Having something that's better than cmd.exe or vbscript is just a bonus. I want the underlying components. I want the tools being brought to the table, not the language. I want to be able to load third party modules or even third party .Net libraries. Right now, with .Net Core 2.0, there's so much I can't do. And so many responses are just "yeah, that's a huge pain and the models don't match between Windows and Linux so we're not going to implement that at all in any way."

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)