Are you running, or scripting for, PowerShell 7?

%3CLINGO-SUB%20id%3D%22lingo-sub-1655070%22%20slang%3D%22en-US%22%3EAre%20you%20running%2C%20or%20scripting%20for%2C%20PowerShell%207%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1655070%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20interested%20to%20know%2C%20who%20out%20there%20is%20using%20%3CA%20href%3D%22https%3A%2F%2Fdevblogs.microsoft.com%2Fpowershell%2Fannouncing-powershell-7-0%2F%3FWT.mc_id%3DPS-MVP-5003460%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EPowerShell%207%3C%2FA%3E%20day%20to%20day%3F%20If%20so%2C%20are%20you%20using%20it%20only%20interactively%20on%20your%20workstation%20or%20are%20you%20actively%20targeting%20new%20features%20in%20your%20scripts%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you're%20not%20using%20it%2C%20why%20not%3F%20Do%20you%20have%20blockers%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20personally%20use%20PowerShell%207%20as%20my%20go%20to%20shell%2C%20but%20my%20scripts%20still%20target%20Windows%20PowerShell%205.1%20(or%20lower)%20as%20that's%20the%20reality%20of%20the%20environments%20I'm%20supporting%20day%20to%20day.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1655070%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1655172%22%20slang%3D%22en-US%22%3ERe%3A%20Are%20you%20running%2C%20or%20scripting%20for%2C%20PowerShell%207%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1655172%22%20slang%3D%22en-US%22%3E%3CP%3EMy%20default%20in%20Windows%20Terminal%20is%20now%20PS7%20on%20my%20laptop%2C%20but%20almost%20all%20the%20servers%20we%20manage%20are%20on%205.1.%26nbsp%3B%20So%2C%20it%20has%20gotten%20me%20in%20trouble%20a%20few%20times%20when%20I%20found%20out%20something%20I%20wrote%20and%20tested%20on%20my%20device%20didn't%20work%20on%20our%20servers.%26nbsp%3B%20We%20do%20use%20it%20extensively%20for%20our%20Jenkins%20slaves%20since%20they%20are%20all%20linux.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1681559%22%20slang%3D%22en-US%22%3ERe%3A%20Are%20you%20running%2C%20or%20scripting%20for%2C%20PowerShell%207%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1681559%22%20slang%3D%22en-US%22%3E%3CBLOCKQUOTE%3E%3CHR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F198382%22%20target%3D%22_blank%22%3E%40Brian%20McLain%3C%2FA%3E%26nbsp%3Bwrote%3A%3CBR%20%2F%3E%3CP%3ESo%2C%20it%20has%20gotten%20me%20in%20trouble%20a%20few%20times%20when%20I%20found%20out%20something%20I%20wrote%20and%20tested%20on%20my%20device%20didn't%20work%20on%20our%20servers.%3C%2FP%3E%0A%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%0A%3CP%3E%26nbsp%3BI%20hear%20that%20100%25!%20Have%20been%20loving%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fmicrosoft.powershell.core%2Fabout%2Fabout_if%3FWT.mc_id%3DPS-MVP-5003460%26amp%3Bview%3Dpowershell-7%23using-the-ternary-operator-syntax%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eternary%20operator%3C%2FA%3E%2C%20but%20limiting%20myself%20to%20using%20it%20interactively%20at%20the%20console%20and%20using%20full%20if%2Felse%20statements%20in%20scripts.%3C%2FP%3E%3C%2FLINGO-BODY%3E
MVP

I'm interested to know, who out there is using PowerShell 7 day to day? If so, are you using it only interactively on your workstation or are you actively targeting new features in your scripts?

 

If you're not using it, why not? Do you have blockers?

 

I personally use PowerShell 7 as my go to shell, but my scripts still target Windows PowerShell 5.1 (or lower) as that's the reality of the environments I'm supporting day to day.

6 Replies

My default in Windows Terminal is now PS7 on my laptop, but almost all the servers we manage are on 5.1.  So, it has gotten me in trouble a few times when I found out something I wrote and tested on my device didn't work on our servers.  We do use it extensively for our Jenkins slaves since they are all linux.


@Brian McLain wrote:

So, it has gotten me in trouble a few times when I found out something I wrote and tested on my device didn't work on our servers.


 I hear that 100%! Have been loving the ternary operator, but limiting myself to using it interactively at the console and using full if/else statements in scripts.

@Joshua King I'm primarily using it on my workstation, but I also use it extensively in my lab environment. But I also run PowerShell v1 in my lab for backward-compatible script testing. I try to make all of my scripts forward compatible to v7, and backward-compatible to v1 whenever possible :)

 

If you'll pardon the self promotion, this is a good overview of the more interesting places to run PowerShell v7: https://www.youtube.com/watch?v=xyfeF0eIhgs

 

I also wrote a chapter for the PowerShell Conference Book Volume 3 (https://leanpub.com/psconfbook3) that talks about using PowerShell on Raspberry Pi, on a retro games arcade machine!

We go through running PowerShell on some of the least Microsoft-y systems you can imagine, with Frank Lesniak. This presentation features a number of PowerSh...
I am using PS7 as my daily driver fro 98% of my work.

@franklesniak I haven't yet had a chance to read Volume 3 of the PowerShell Conference Book, but the concept in general of running PowerShell on single board computers like the Pi is really interesting to me.

What's PowerShell's job on there (I'm assuming not running the games? :p)?

@Joshua King my chapter is about using the Raspberry Pi as an arcade game emulator. However, arcade emulation is tricky and has an overwhelming number of games, many of which are not playable or relevant. So in the chapter, I use PowerShell to sort through the "database" of games, pulling in auxiliary data sources to help. Since the emulation platform (RetroPie) is primarily run on Raspberry Pi, I wanted to make sure my code worked on Raspberry Pi :)