r/PowerShell • u/PowerShellChallenge • Mar 04 '20
New PowerShell Version - v7.0.0
https://github.com/PowerShell/PowerShell/releases/tag/v7.0.06
3
u/dany20mh Mar 04 '20
If this is the final release, what's the best way to install it?
I tried this command and it gives me 6.2.4:
iex "& { $(irm https://aka.ms/install-powershell.ps1) }"
If I add -Preview to it and use it like this, I get 7.0rc3
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -Preview"
5
u/halbaradkenafin Mar 04 '20
It's not quite there yet. The binaries haven't been published yet but should be in the next day or so.
2
u/rjmholt Mar 04 '20
This should work now that the change has gone in. Try the top command again now :)
3
u/Justify_87 Mar 04 '20
Does this finally replace Powershell 5.1? Or is it still it's own core release?
5
u/halbaradkenafin Mar 04 '20
It's a side by side install. Windows powershell is not going anywhere any time soon.
1
u/gex80 Mar 04 '20
That feels dirty.
1
u/halbaradkenafin Mar 05 '20
Why? We've had cmd shipping in Windows for years after it's been deprecated. It's there for backwards compatibility, the same is true for Windows PowerShell.
The support model for PowerShell 7 doesn't line up with Windows so there's some issues the team needs to work on to get it shipping in the box (if they ever can) and it'll still not replace Windows PowerShell since they have different features due to different versions of .Net. The compat is pretty close but not enough to remove 5.1 so we end up with side by side.
1
u/gex80 Mar 05 '20
Well I understand the technical reasons why its separate. But now we have cmd, powershell (5.1), and powershell7. Our automation tools like ansible can only call powershell. And I'm just so used to typing powershell, enter. From a user perspective it's more things to keep in mind. Like Ubuntu vs Centos. Sure they're both linux and sure they both work almost identical, but it still annoying to remember when to use yum vs apt and forgetting which you're on.
1
u/halbaradkenafin Mar 05 '20
Sure, but the automation tools will catch up and muscle memory will too. I'm only using it locally at the moment, I haven't rolled it out to the small number of servers I've got (and won't because I'd like to throw them away soon). For daily use I've got windows terminal pinned on my task bar and that defaults to 7 so I don't have to remember which I'm in (the background colour helps a bit) and have to make an effort to open 5.1 (pretty much just for when I need an admin prompt for chocolatey).
3
u/Emiroda Mar 04 '20
They've said somewhere (can't find it), that PowerShell 5.1 is going to have the same "support" as cmd has: Support forever, since it powers applications that won't get changed for 10-20 years.
3
u/pnlrogue1 Mar 04 '20
PowerShell 5.X and earlier use the full .Net framework. They are now called Windows PowerShell. Microsoft are not upgrading Windows PowerShell anymore.
PowerShell 7 uses .Net Core and is the channel that will continue to see active development. Wikipedia had a good section on this.
2
u/Justify_87 Mar 04 '20
I know but it was rumored that 5.x would eventually be replaced by a core release. There is some Microsoft blog mentioning it
2
u/Emiroda Mar 04 '20
https://twitter.com/Steve_MSFT/status/1213080494323224577
As Steve said, they'll make an announcement very soon.
1
u/pnlrogue1 Mar 04 '20
Eventually, but installing 7 will not remove 5 (unless they've changed something). You're probably going to be waiting until Server 2022 for that at a guess. PowerShell needs to be pretty much 100% backward compatible with existing modules in Windows before they could do that
2
u/gschizas Mar 04 '20
What I really want is a way to replace Out-GridView -passthrough
I've tried making a .NET pure text equivalent cmdlet, but I'm having trouble with the TUI handling (probably a library problem).
2
u/SeeminglyScience Mar 04 '20
You can also just keep using
Out-GridView(it's back).1
u/gschizas Mar 04 '20
Oh, cool. But I really wanted to make a text-only equivalent (but it's not a stopper now).
1
2
u/rjmholt Mar 04 '20
The GraphicalTools module has a prototype of this. Works really nicely
1
u/gschizas Mar 04 '20
Oh my! I think that's what I was trying to build. And with that exact framework, too!
How come I didn't even know this was a thing?
2
u/fatalicus Mar 04 '20
Fantastic! Now update all the Microsoft 365 modules so I can use them in core with modern auth.
1
u/Tekwhat Mar 04 '20 edited Mar 04 '20
Just use conditional Access to not prompt for MFA inside your companies public IP range. Works great for Powershell.
2
u/rjmholt Mar 04 '20 edited Mar 04 '20
The release just went live then (the tagged commit in the OP had to be set up beforehand).
Some handy links for you:
On Linux, just run the package manager upgrade and it will update the
powershellpackageOn macOS,
brew cask upgrade powershellshould do the sameiex "& { $(irm https://aka.ms/install-powershell.ps1) }"should now install PowerShell 7 (it was waiting on this PR to go in) (NOTE: I don't condone runningirm | iex)
A couple of bits might take a day or two extra to come out:
The MSIX (it will go to the release page above and you can install it with
Add-AppxPackage -Path $pathToMsix)The macOS Homebrew package is community maintained, so usually comes out 24-48 hours after the release is published
1
u/tstephansen Mar 04 '20
Does it actually work with VsDevShell now? I used ps core with the vs command line until the released the powershell module. It didn’t work with ps 6 though so I went back to regular powershell.
1
u/jonr7670 Mar 04 '20
Dumb question alert. I downloaded the zip. I can't see the installer. How do I install it?
2
u/Emiroda Mar 04 '20
The link up top is just source code. They haven't written the fancy announcement posts yet, so installers aren't downloadable yet.
If you want to learn something new and compile the source code yourself, here's how: https://github.com/PowerShell/PowerShell/blob/master/docs/building/windows-core.md
1
u/poshftw Mar 04 '20
https://github.com/PowerShell/PowerShell and scroll to 'Get PowerShell' section.
1
0
Mar 04 '20
[deleted]
5
u/jborean93 Mar 04 '20
The AD modules have worked with PowerShell Core (on Windows) for a while now. You just need to make sure your Windows install is new enough to contain the compatible cmdlets. For me the AD cmdlets work on Server 2019 which I believe is on the same build as Windows 10 1809. Potentially older versions also work but I don't have any of those builds to test.
PS C:\Windows\system32> $PSVersionTable Name Value ---- ----- PSVersion 6.2.4 PSEdition Core GitCommitId 6.2.4 OS Microsoft Windows 10.0.17763 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0 PS C:\Windows\system32> Get-ADUser vagrant-domain DistinguishedName : CN=vagrant-domain,CN=Users,DC=domain,DC=local Enabled : True GivenName : Name : vagrant-domain ObjectClass : user ObjectGUID : 928a0ddf-e92b-4c7f-8d59-3337956f5c94 SamAccountName : vagrant-domain SID : S-1-5-21-2959096244-3298113601-420842770-1104 Surname : UserPrincipalName : [email protected]1
u/Sebazzz91 Mar 07 '20
So it doesn't work on plain Windows Server 2016.
1
u/jborean93 Mar 07 '20
I’m pretty sure server 2016 is based on Windows 10 1607 which definitely doesn’t have the ad module version that supports PowerShell core. PowerShell 7 should still have a way to import modules that aren’t compatible through implicit remoting but you would have to test that.
3
u/halbaradkenafin Mar 04 '20
It works on 1809 onwards and with PS Core 6.1 or remoting to a box with them.
1
u/Emiroda Mar 04 '20
Are the ActiveDirectory and grouppolicy modules working when hosted on Windows?
Has worked since 6.1.1.
https://www.reddit.com/r/PowerShell/comments/f6qef2/psa_activedirectory_module_works_natively_with/
28
u/DigitalWhitewater Mar 04 '20
Please inform a ignorant fool... what is the hype and highlights in PS v7.0.0? I’m honestly curious.