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

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.

→ More replies (6)
→ More replies (1)

2

u/bblades262 May 22 '18

What is implicit remoting?

2

u/Lee_Dailey [grin] May 22 '18

howdy bblades262,

this may help [grin] ...

Remoting the Implicit Way – Hey, Scripting Guy! Blog
— https://blogs.technet.microsoft.com/heyscriptingguy/2013/09/08/remoting-the-implicit-way/

take care,
lee

→ More replies (5)

8

u/[deleted] May 21 '18

The problem with most of these things is the Powershell team doesn't own the code that the other tools use. Active directory is technically a snapin for Powershell whose codebase is owned by the team that maintains active directory. Same goes for Exchange. Powershell is ready and waiting for the other teams to make the necessary changes to their codebases in order to facilitate making things work in Core. It's a hot mess in layman's terms.

0

u/[deleted] May 22 '18

[deleted]

3

u/calmor15014 May 22 '18

This is how Microsoft has functioned for a while. Things that seem like they should work well and be integrated are managed by separate groups with separate agendas. Sometimes it's just more apparent than others.

Not that any other software company doesn't have the same issues, but because Microsoft makes almost everything, it is more annoying. I feel less irritated when an Adobe plugin for Office doesn't work right than when PowerPivot crashes for no reason. Again.

4

u/sid351 May 21 '18

I'd be happy with a secure way of storing credentials, but the secure string stuff isn't in .Net core. :(

It'd mean I could move all of my automation scripts fully on to a Linux server without having to relearn how to consume the various web services with a new language (all while saving some sweet sweet licence money).

With that said, I'd be happy with the progression of PS Core to be that of PS1 -> 5. It'd didn't take that long for pretty powerful functionality to arrive really.

2

u/Henry_Horsecock May 22 '18

but the secure string stuff isn't in .Net core. :(

Goddamn that sucks... what are we supposed to do?

→ More replies (1)

7

u/halbaradkenafin May 21 '18

A lot of people want AD module moving to PS Core but need to keep telling the AD team to do the work for it. The PS team can only do so much and their focus is on PS itself, it's up to the product teams to move their modules to core and it's up to customers to keep telling the teams to do it (via user voice or other places).

23

u/da_chicken May 21 '18

I don't care about the politics or organization of Microsoft. That's 100% the job of Microsoft leadership to get sorted out. Citing corporate politics as a reason for providing an inferior product doesn't fix that you're providing an inferior product, and making your politics my problem is a ridiculous attitude. If moving to PowerShell Core means that PowerShell modules need to be redeveloped, well, MS's leadership needs to get on that. Customers should absolutely be able to provide feedback, but it shouldn't take customer feedback to tell MS that their new product isn't up to snuff because it lacks features the old product has.

4

u/halbaradkenafin May 21 '18

I'm sure the other teams have been told to do what needs to be done to make them compatible with PS Core but they have a ton of other things to work on too. The priority of a lot of that work is driven by what their customers want and need, if the customers aren't pushing for something then it drops down the list.

This isn't really a politics thing, it's a simple case of "customers want x more than y so we'll put more effort into it"

3

u/spikeyfreak May 22 '18

customers want x more than y

Are you saying that Microsoft customers want PowerShell that works on Linux more than they want ActiveDirectory, Exchange, and SQL modules for PowerShell?

5

u/ka-splam May 22 '18

No, he's saying that Microsoft customers have seen "cloud" in Gartner's magic quadrants, are frothing at the mouth to sign 7 or 8 figure contracts with anyone who can shout "cloud" loud enough, and Microsoft wants to be there, and that means Azure Stack and Teams and Azure Cognitive Services.

They might devote some energy to some edge case corner of a totally non-billion-dollar tool used by some non-bill-paying admins, if that wheel squeals loudly enough.

2

u/halbaradkenafin May 22 '18

I'm saying more vocal customers want some random feature of AD more than they want PS Core compatibility for the AD module, or at least that's how the team might see it.

If we want PS Core version of the AD module then we need to tell the AD team that, and keep telling them.

→ More replies (4)

3

u/[deleted] May 21 '18

If it's "Powershell in the cloud" why wouldn't you have access to those modules? I mean sure it would run on Linux but I don't see how those modules couldn't be run in containers and just save some of the overhead. << Novice PS user, so please let me know how wrong I am if that's the case.

11

u/da_chicken May 21 '18

.Net Core is a complete rewrite of .Net focused on multi-platform and containers. They're different enough that you should consider them completely different products. Many of the classes available in the .Net Framework simply don't exist in .Net Core. Some classes which exist in the .Net Framework will never be implemented in .Net Core because, like I said, the models don't match between Linux and Windows. You can't just Import-Module ActiveDirectory or Import-Module SqlServer on PowerShell Core 6 and go. The modules are written for Windows PowerShell. Even if the module exists, there will be missing commands (SqlServer is still missing Invoke-Sqlcmd, for example).

There is a compatibility pack for .Net Core which adds back in several missing features, but it's not really finished yet.

So, yeah, PowerShell Core will be great in 2 to 5 years when it's at version 6.8 or 7.2 and based on .Net Core 3.1 or whatever and there's feature parity. Until then, it's really not a usable tool because it doesn't do what I use PowerShell for. I'm not going to run both Windows PowerShell and PowerShell Core right now. That's just a mess. Too much works in Windows PowerShell and doesn't work in PowerShell Core.

→ More replies (2)

2

u/bolunez May 21 '18 edited May 21 '18

Exactly. The* AD module doesn't work, trying to load the ConfigMgr module straight up crashes PWSH, etc.

PS Core may be "Finished" but it's a long way from being a viable replacement for Powershell 5.

→ More replies (9)

1

u/SupremeDictatorPaul May 22 '18

Core feels closer to PowerShell 1.5 than 1.0. But 2.0 feels so much more advanced because there were so many modules made available at the same time. Although, it is probably closer to 2.0 in reality.

→ More replies (4)