r/PowerShell • Community Blogger • Nov 18 '17

PowerShell Core v6.0.0-rc Released! That's right: Release Candidate!!!

https://github.com/PowerShell/PowerShell/releases/tag/v6.0.0-rc
161 Upvotes

58 comments sorted by

23

u/markekraus Community Blogger Nov 18 '17 edited Nov 18 '17

FYI for Dallas/Fort Worth redditors: I will be speaking tomorrow at the NTCPUG PowerShell SIG on the PowerShell Core Web Cmdlets In Depth. Sig meets at 8am and I will start around 8:30am. It will be an hour long presentation followed by Q&A. https://sites.google.com/site/powershellsig

Slides from today's presentation: https://gitpitch.com/markekraus/2017NovemberWebCmdletsTalk

2

u/GavinEke Nov 19 '17

Nice was just reading through the git pitch slides and was looking for some guidance, I have a module which calls a rest API that only works using TLS 1.2, so in this module I have [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 to get the Invoke-RestMethod to work in Windows PowerShell.

How do you feel this should be handled in a module to work in PSCore and Windows PowerShell?

3

u/markekraus Community Blogger Nov 19 '17

Either use -SslProtocol on a per-call basis:

Invoke-RestMethod -SslProtocol Tls12

Or sett he default parameter for it:

$PSDefaultParameterValues['Invoke-RestMethod:SslProtocol'] = 'Tls12'

If your API is TLS 1.2 only, IRM should work by default. I have a pester test in the project that proves as much.

2

u/GavinEke Nov 19 '17

Thanks, I am guessing that SslProtocol parameter is new to 6 as I don't see it when trying it with 5.1 which brings me into a new question as I am unsure if this is a bug and I should file an issue or if it is by design as 6.0 isn't stable yet. Basically I was thinking about doing a simple

If ($PSVersionTable.PSVersion -lt [version]'6.0') { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 }

but currently v6.0.0-rc is returning true to that if statement which doesn't seem right. I have changed the if statement version to be less then 5.2 to get it working as expected but as stated seemed odd that PSCore returns true to being less then 6.0

4

u/markekraus Community Blogger Nov 19 '17

I am guessing that SslProtocol parameter is new to 6

Very new. As in, it was just merged this week before RC. :)

6.0 isn't stable yet

This RC should be pretty stable. There aren't many outstanding issues that would affect stability. There should only be minor fixes between now and GA.

but currently v6.0.0-rc is returning true to that if statement which doesn't seem right.

PowerShell Core uses semantic versioning which kind of screws with that. You need to cast $PSVersionTable.PSVersion to version first:

[version]$PSVersionTable.PSVersion -lt [version]'6.0'

Better yet (and the recommended way) is to use the PSEdition property:

$PSVersionTable.PSEdition -ne 'Core'

2

u/GavinEke Nov 19 '17

Perfect, Thanks for the responses this really helps.

1

u/fourierswager Nov 19 '17

Good slides! Wish I could've been there!

2

u/markekraus Community Blogger Nov 19 '17

I plan to reach out to other PowerShell SIGs and PUGS to see if they are interested in the presentation. Maybe one of those will get recorded. I will also be turning the content into a blog post and including more info that I couldn't shove into an hour presentation. I originally planned to cover all of the fixes made, but ended up narrowing it down to the major features and the fixes I had a hand in.

2

u/midnightFreddie Nov 18 '17

8am? I might stay up that late...

12

u/markekraus Community Blogger Nov 18 '17

For those who have questions about when GA will be and what the support model will look like, please checkout the new PowerShell Team Blog article: https://blogs.msdn.microsoft.com/powershell/2017/11/17/powershell-core-6-release-candidate/

3

u/[deleted] Nov 18 '17

Sheesh you were busy this time around! Thanks for your contributions :-)

5

u/markekraus Community Blogger Nov 18 '17

I personally feel like I was slacking. Since this was an RC release I was only able to get the new features added that were already approved. The rest is kind of clean up work. But I knew I wouldn't get any real major changes in and things were busy with my real job, so, I kinda had lower PR volume between beta.9 and RC. hehe

3

u/r3setbutton Nov 18 '17

This might be off-topic (thanks for your hard work btw), but any fixes to Intellisense?

5

u/markekraus Community Blogger Nov 18 '17

There are problems with intellisense? I haven't seen any myself. Have you checked the issues? if you don't see one open for your problem, please open one so someone can take a look (won't be me... the console and engine code are areas I avoid :) ).

7

u/r3setbutton Nov 18 '17

Massive amounts of lag or it simply exits out. I'll check the issues log. Thank you for pointing me in the right direction.

2

u/zNzN Nov 18 '17

Roaming profiles always make my intellisense slow, but it's typically due to network lag ... e.g. Vpn over a suboptimal wifi connection

3

u/r3setbutton Nov 18 '17

No roaming profiles and it does it both at work with a multi-gigabit connection and at both houses with 150/20 connections. Does it on every machine that I use it on too. Win7, Win8.1, Win10, Server 2012R2, and Server 2016. PS versions 4.0, 5.0, and 5.1 IIRC.

3

u/Ominusx Nov 18 '17

I am woefully behind on all this.

Is PowerShell Core ready as a replacement for PowerShell (using .NET)?

How would I know what will and won't work with PowerShell core?

Presumably .NET Core is missing a lot of the stuff in the full fat .NET framework

5

u/markekraus Community Blogger Nov 18 '17

Is PowerShell Core ready as a replacement for PowerShell (using .NET)?

It's not intended for be a replacement for Windows PowerShell at this time. in time PowerShell Core will over take Windows PowerShell. But you can run PowerShell Core 6.0.0 side-by-side with Windows PowerShell 5.1. You'll even be able to run PowerShell Core 6.1.0 side-by-side with 6.0.0 and 5.1. Windows PowerShell 5.1 support lasts for another 15 years or so, but, it will not be getting feature updates just critical bug fixes and security patching. there will never bee a 5.2, only 5.1.XXXXXs

How would I know what will and won't work with PowerShell core?

That's kind of hard to answer. Many community modules will "just work" assuming they are not heavy on Full .NET objects. When 6.0.0 is GA released, there will be a list of official Microsoft modules and their support status in Core. Some of them also "just work" and others will not. Pretty much any RSAT module that is a PSSnapin (like the AD module) wont work because PSSnapins have been deprecated.

Presumably .NET Core is missing a lot of the stuff in the full fat .NET framework

Yes, but much of what is missing is around GUI, low level windows APIs, and APIs that MS has been telling people to stop using for many versions now. So while it is much slimmer, much wont be missed.

2

u/Ominusx Nov 18 '17

It seems awesome. I was just a little concerned that I was getting left behind haha.

It will be interesting to see how this goes.

4

u/Lee_Dailey [grin] Nov 18 '17

howdy markekraus,

i saw a certain name several times in that list ... my felicitations, good sir! [grin]

the one that caught my attention was this one ...

Add char range overload to the .. operator, so 'a'..'z' returns characters from 'a' to 'z'. (#5026) (Thanks @IISResetMe!)

wheee! [grin]

take care,
lee

8

u/markekraus Community Blogger Nov 18 '17

Yea. That new range feature is awesome

'←'..'↕'

Result:

←
↑
→
↓
↔
↕

1

u/Lee_Dailey [grin] Nov 18 '17

howdy markekraus,

oooo! even cooler than i thot it would be ... [grin]

take care,
lee

4

u/docphilgames Nov 18 '17

I'm still having trouble finding reasons to use Powershell Core in an enterprise environment. So excuse me if I'm not excited for the RC

9

u/markekraus Community Blogger Nov 18 '17

Well, this is still only RC. And 6.0.0 might not do it for everyone. But, once all the product teams start porting their modules to Core, you might change your tune. Tons of new features are being added (with a ton more "in the pipe") in core that will never make it to Windows PowerShell. And, core can run side-by-side with Windows PowerShell (and even with other versions of itself) so you can introduce it where it makes sense to. Leverage new Core features when it makes sense and continue to use Windows PowerShell where it doesn't.

Enterprises which are cloud heavy and cross platform will start to see the benefits of switching. Those who are still heavy on-prem, traditional, and windows -only might see the benefits a bit slower. But that's ok. There is a 6 month release cycle planned so yea, maybe 6.0.0 wont be for you, but in time it will be.

5

u/DondoYonderboy Nov 18 '17

This is what I’m really looking forward to - the modules getting ported to pwsh. I use a Mac laptop outside of work and the ability to do some of the management tasks, mostly revolving around Azure, AzureAD and Office365 will be really nice once that happens.

4

u/markekraus Community Blogger Nov 18 '17

The azure ones will come soon. They already have some of the azure functionality ported: https://www.powershellgallery.com/packages/AzureRM.Netcore/0.9.1

Azure AD (and a bunch of other MS modules) would be almost 100% core compatible if they would use something other than the ADAL library for authentication. The main thing that holds them back is the winforms popup for OAuth authentication. WinForms is not in CoreFX, thus not available in PowerShell Core. as soon as they figure that part out, I expect to see a great number of cross platform MS modules.

The ones tied to the OS and RSAT, that's going to be a process that we as community members and Microsoft Customers have the ability to drive. If you want to use the new features in PowerShell Core with RSAT tools, we need to go complain to Microsoft (through your normal support channels).

3

u/docphilgames Nov 18 '17

We are a mixed environment, so if what modules you are talking about are actually going to make sense for managing that then I'll dive deeper into Core. And I do hope that it becomes as robust as Windows Powershell has been.

Just because I'm curious, can you think of a good use for Core in a Windows/Mac environment?

2

u/markekraus Community Blogger Nov 18 '17

can you think of a good use for Core in a Windows/Mac environment?

Standardizing configuration scripting on a single language is a good use case.

Also remote management. Getting the macOS and Windows clients manageable remote from a single langue is pretty awesome. You might still have scripts that are tailored to each environment, but at least they would all be in the same language.

4

u/calladc Nov 18 '17

Do you do any administration of systems via rest? Or any interoperation with linux/freebsd/cisco ios ?

Personally, a native ssh client from powershell has always been annoying. I understand that there have been 3rd party libraries and modules built on those libraries. But when i'm jumping through systems, i don't want to have to worry about having to rely on a 3rd party tool to ssh from a jump host to another host through a firewall.

native Syslog functionality is amazing.

For my web tier applications, ps6 is so inviting.

4

u/markekraus Community Blogger Nov 18 '17

Do you do any administration of systems via rest?

I know, right??? Invoke-RestMethod in PowerShell Core is absolutely amazing now. I'm not just bragging about my contributions. -FollowRelLink is so awesome and that one wasn't one of mine. Automatic API pagination? Why, yes please!!!

3

u/calladc Nov 18 '17

ConvertFrom-Json -AsHashTable

Mother of god..

2

u/markekraus Community Blogger Nov 18 '17

Yea... like... I get people being bummed out by PowerShell Core not supporting all of the Windows RSAT stuff. But so many of these awesome new features in the language and cross-platform support is really exciting to me. -AsHashTable is a prime example.

2

u/calladc Nov 18 '17

Do you know if implicit remoting is supported? if so, then i'll just have a management server with the rsat modules installed, and use ps6 to remote the commands

2

u/markekraus Community Blogger Nov 18 '17

I am very weak on my knowledge of the remoting capabilities. It's not something I deal with often.

2

u/calladc Nov 18 '17

3

u/markekraus Community Blogger Nov 18 '17

I meant that I know about implicit remoting, and I know you can do it in core. but. I don't know if you can implicit remote from core to 5.1. I'm weak around what all works between them because usually I'm not remoting as i work with AD or APIs more often than not.

3

u/calladc Nov 18 '17

I work with AD, I use this for computers where i dont have rsat, but i want to be able to use the ad cmdlets and not resort to modifying attributes directly via ldap.

exchange and sharepoint are other examples i've used for implicit remoting, where i didnt have a console, or i wanted to be able to pipe to/from objects in a different version of powershell than my exchange/sp environment at the time

2

u/calladc Nov 18 '17

-FollowRelLink

I have not had the pleasure..

5

u/markekraus Community Blogger Nov 18 '17
$url = 'https://api.github.com/repos/powershell/powershell/issues'
$Issues = Invoke-RestMethod $url -FollowRelLink -MaximumFollowRelLink 5

That gets the first 5 pages of issues from the PowerShell repo. so sick!!

8

u/declar Nov 18 '17

Can you install other MS modules on PSCore? Like specifically, RSAT tools or the ActiveDirectory module?

5

u/jantari Nov 18 '17

The day this is possible I'm switching my work ThinkPad to some GNU/Linux with MATE - on a new SSD lol, can't risk losing the trusty Win 10 install 🙏

0

u/[deleted] Nov 18 '17

[deleted]

5

u/jantari Nov 18 '17

A virtual machine of what? Linux? Because I don't need it. We may run a mixed environment but the majority of servers and clients are Windows, for the *nix systems we do have WSL is perfectly good for any occasional manual work required over ssh.

I've looked into QubesOS for work because It'd allow us to cut our own internet access on the Windows-side that we currently have and only have free internet access fully decoupled from our local network on one specific Linux VM. It'd be the ideal setup imo, but a lot of work to set up and there's bound to be problems with QubesOS itself (no seamless mode for Win10 comes to mind)

Right now I run Windows 10 for RSAT, Internet Explorer, the Win32 vSphere Client (we broke our HTML5 Client lol, gotta get on repairing that sometime ...) and a few nice-to-have tools like Devolutions RDP Manager. But I'm already in the process of replacing our last tool that only works properly in IE and then once the RSAT-cmdlets run on PSCore I'd just give it a try for the heck of it

0

u/[deleted] Nov 18 '17

[deleted]

2

u/jantari Nov 18 '17

For a few GUI tools that aren't scriptable, most notably one of our Spam filter appliances. Also user management in some pieces of specialized software in the fields of inventory management, human resources and finance - again no option to do it from the cli on these.

2

u/Swarfega Nov 18 '17

Or New-PSSession to a computer with RSAT installed ;)

3

u/[deleted] Nov 18 '17

I've had trouble doing new-pssession from Linux to Windows. Is there a trick or module I'm missing?

2

u/docphilgames Nov 19 '17

As of right now, no.

7

u/[deleted] Nov 18 '17

This makes me wonder : why do Core and the normal Powershell exist as two different things?

11

u/[deleted] Nov 18 '17

In short words: Windows comes with .NET (CLR) and Windows PowerShell (and some modules) require .NET (CLR). .NET Core (CoreCLR) is cross-plattform, which was a requirement for the new PowerShell, hece PowerShell Core is built on .NET Core (CoreCLR).

If .NET Core replaces .NET, just as it happend in Windows Nano, I expect that all PowerShell's will be merged to one. However, if this even ever happens, I'm sure it will take several years. (That is only a guess though, such a plan was never communicated.)

1

u/[deleted] Nov 18 '17

Thanks for the the clarification.

1

u/ThePegasi Nov 18 '17 edited Nov 18 '17

If .NET Core replaces .NET, just as it happend in Windows Nano, I expect that all PowerShell's will be merged to one.

Isn't 5.1 simply being replaced by PSCore?

1

u/[deleted] Nov 20 '17

For now, it's not. Windows PowerShell 5.1 (or 5.x?) remains what comes with Windows. You can add PowerShell Core 6, but not replace it with Windows PowerShell 5.1.

2

u/ThePegasi Nov 20 '17 edited Nov 22 '17

What I mean is that Microsoft have already said Powershell proper is being replaced by Powershell Core going forward. There will be security updates to Powershell 5.1, but no feature updates. Hence Powershell Core's version number being 6.x.x

https://redmondmag.com/articles/2017/07/17/windows-powershell-6.0-and-powershell-core.aspx

How long it'll take MS to stop bundling 5.1 with Windows once 6.x.x reaches full release is another question.

3

u/fourierswager Nov 18 '17

All -

Use my Update-PowerShellCore function to update/initial install PowerShell Core.

NOTE: For those who've downloaded and used the Update-PowerShellCore function before, I had to update it just now to handle the 6.0.0-rc install, so please grab the latest version here:

https://github.com/pldmgg/misc-powershell/blob/master/MyFunctions/PowerShellCore_Compatible/Update-PowerShellCore.ps1

3

u/Thotaz Nov 19 '17

With powershell core moving at such a nice pace it would be nice to see visual studio code get up to par with ISE, specifically I'm interested in getting the same integrated console experience with the intellisense pop-ups, and moving the cursor around with the mouse. Another useful feature missing is the remote powershell tab feature.

3

u/upward_bound Nov 19 '17

I'm finally able to connect to O365 to administer from OSX.

Thumbs Up!

0

u/[deleted] Nov 18 '17

[deleted]

3

u/nightroman Nov 18 '17

Good! But, to be honest, in the ideal world, returning a hashtable should be the default. Hashtables allow dot-notations, too. But they are in many ways more useful than PSCustomObject. It's about "property bags", after all. And hashtables fit much better.