r/PowerShell • u/PowerShellChallenge • Oct 23 '19
New PowerShell Version - v7.0.0-preview.5 Release of PowerShell Core
https://github.com/PowerShell/PowerShell/releases/tag/v7.0.0-preview.57
u/signofzeta Oct 24 '19
Null coalescing, ForEach-Object -Parallel, and now I have my && and || operators? Push this to every Windows 10 machine worldwide already! PowerShell 6 is my daily driver and it’s already looking dated.
1
0
3
u/rjjm88 Oct 24 '19
Here I am, stuck using Powershell v2 because my clients are afraid of change. Sigh, I shall dream of you, Powershell v7.
3
u/Swarfega Oct 24 '19
v6 onwards doesn't replace/upgrade Windows PowerShell so why can't you install 6 or 7?
2
u/SteveL_Msft Software Engineering Manager, PowerShell Oct 24 '19
Exactly! PS6/7 deliberately works side-by-side with Windows PowerShell. PSv2 is the worst because it doesn't have all the latest security enhancements to PS including Antimalware scanning and detailed logging among other security improvements.
5
u/Atomic0691 Oct 23 '19
I think the last piece preventing me from migrating is lack of Active Directory connectivity. I’ve seen they want to provide an avenue to make this work in 7; does anyone know if this is still planned for 7.0?
3
u/signofzeta Oct 24 '19
Are you talking about the [ADSI] cast operator, or the ActiveDirectory module from Windows Server? I’m really missing the latter.
4
u/Atomic0691 Oct 24 '19
ActiveDirectory Module
2
u/signofzeta Oct 24 '19
I hear you. I’m waiting for AzureAd, MsOnlineServices, and maybe MicrosoftTeams to get ported to modern PowerShell.
10
u/SteveL_Msft Software Engineering Manager, PowerShell Oct 24 '19
We have another feature coming in Preview 6 that will allow importing Windows PowerShell only modules into PowerShell 7. https://github.com/PowerShell/PowerShell-RFC/pull/226/files
1
u/signofzeta Oct 24 '19
That’s wonderful. I’m just surprised Microsoft hasn’t updated more of their other modules, like AzureAD and MicrosoftTeams, for .NET Core compatibility.
3
u/SteveL_Msft Software Engineering Manager, PowerShell Oct 24 '19
AzureAD is coming. It already works in Azure CloudShell which runs on Linux using PSCore6.2. Not sure about Teams. We'll be engaging more teams within Msft about PS7 compatibility as we get closer to GA.
1
u/nerddtvg Oct 24 '19
Yeah but Cloud Shell uses a preview version called AzureAD.Standard.Preview based solely on .NET Core. It works... Up until you use SearchString on a Get-AzureADUser request.
1
u/nerddtvg Oct 24 '19
So have you tried it? The module compatibility fixed in PS7 lets you run this module just fine. Plus the module is entirely up to the AD product team, not PowerShell team.
2
u/Inquisitor_ForHire Oct 24 '19
I think everyone understands that the module compatibility is up to the product team, but you'd think there would be some executive hammering the "get compatible" message up and down the product teams. The flagship "products" from MS should all have compatible modules. I can even understand not doing them for PS6 as we can consider that a transitional shift, but for PS7 it should absolutely be required.
1
u/nerddtvg Oct 24 '19
Since the AD module, among others, relied so heavily on .NET Framework calls that are not compatible or have alternatives in .NET Core, it was a lot more than just saying "get compatible." The delay was waiting .NET Core 3 which brought a lot of .NET Framework functionality into .NET Core.
With PowerShell 7 using .NET Core 3.0, we've seen a much greater increase in compatibility. And now that only few outliers remain, it makes it a much more manageable task to fix those modules.
https://devblogs.microsoft.com/powershell/the-next-release-of-powershell-powershell-7/
PowerShell Core 6.1 brought compatibility with many built-in Windows PowerShell modules, and our estimation is that PowerShell 7 can attain compatibility with 90+% of the inbox Windows PowerShell modules by leveraging changes in .NET Core 3.0 that bring back many APIs required by modules built on .NET Framework so that they work with .NET Core runtime. For example, we expect Out-GridView
to come back (for Windows only, though)!So have you tried many of the native Windows modules in PS7? How many have you found that don't work at all or at least partially?
1
u/nvpqoieuwr Oct 24 '19
the module is entirely up to the AD product team, not PowerShell team.
This doesn't matter even a little bit. It's Microsoft's problem, and they need to make sure it's fixed.
1
u/nerddtvg Oct 24 '19
So have you tried it? Because it works in PS7 just fine.
1
u/nvpqoieuwr Oct 24 '19
I have no use case for it, but I've seen that sentiment since PSCore was announced.
1
u/nerddtvg Oct 24 '19
So PowerShell Core 6 was releasted in January 2018. We're nearly two years past that now.
1
u/nvpqoieuwr Oct 24 '19
Yeah, and the excuse that "Other team is supposed to do this" still doesn't hold water. Ever. Never did, never will.
You don't see Ford put a car out and say "Well, yeah, we changed everything about it, and it uses square tires now, but the tire division is responsible for it."
1
u/SteveL_Msft Software Engineering Manager, PowerShell Oct 24 '19
I think the point /u/nerddtvg was making is that the AD Module was fixed for compat with PSCore6.1 a long time back...
→ More replies (0)1
2
u/KevMar Community Blogger Oct 24 '19
It's mostly worked for a while. I think one of the common bugs is resolved in 7.0. what issue are you running into?
2
u/theycallmebigbird12 Oct 23 '19
I wonder how long it will take PS 7, when released, to become available on the Linux repositories.
4
u/SteveL_Msft Software Engineering Manager, PowerShell Oct 24 '19
It usually takes less than a day. We publish it to the Msft Linux repo immediately but takes maybe an hour or so for it to show up.
1
0
Oct 23 '19
[deleted]
12
u/rjmholt Oct 23 '19
Set the environment variable
POWERSHELL_UPDATECHECK_OPTOUTto1ortrueoryesbefore starting pwsh, and it won't do the check5
u/sir_sandwiches_a_lot Oct 24 '19
That enhanced/clearer error output would be fantastic. The current format does trip up beginners a lot.
3
u/Swarfega Oct 24 '19
Off-topic but does anyone know how I can replicate Steve's examples where it shows the execution time and current path?
[28.72ms] /Users/steve/repos/PowerShell
5
Oct 23 '19
[removed] — view removed comment
4
Oct 23 '19
[removed] — view removed comment
0
Oct 23 '19
[deleted]
0
u/taw20191022744 Oct 25 '19
Ok, being new to PowerShell, what's wrong with it? Why is one way better?
0
Oct 24 '19
[deleted]
2
u/Lee_Dailey [grin] Oct 24 '19
howdy taw20191022744,
they are talking about readability. [grin]
breaking the
-replace 'this', 'that'on the comma works but is seriously more difficult to scan when reading code.take care,
lee2
u/taw20191022744 Oct 25 '19
Thx for the explanation!
1
u/Lee_Dailey [grin] Oct 25 '19
howdy taw20191022744,
you are quite welcome! glad to help a little bit ... [grin]
take care,
lee1
u/AutoModerator Oct 24 '19
Sorry, your submission has been automatically removed.
Accounts must be at least 1 day old, which prevents the sub from filling up with bot spam.
Try posting again tomorrow or message the mods to approve your post.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
21
u/mxjq2 Oct 23 '19
Yes null coalescing!! No more inline if else statements.