简体   繁体   中英

What is the difference between PowerShell 5.1, 6, and core?

From what I understand PowerShell 6 and Core uses the .Net Core framework and is cross-platform while PowerShell 5.1 uses the .Net framework. To my understanding PowersSell Core is also not as developed as 5.1

What would you recommend I start learning? I am still a high school student and want to work in INFOSEC. I want to start learning PowerShell to create scripts that edit settings automatically. Would you recommend I start with 5.1, 6, or core? Any resource recommendations?

The naming has changed a bit over time. In the beginning, PowerShell was Windows only, as it used the full .NET Framework. These are PowerShell versions 1.0 through 5.1, and nowadays we usually call this "Windows PowerShell". The binary for this is powershell.exe .

Starting with PowerShell 6.0, the language uses .NET Core, and became cross-platform. This one has a binary named pwsh or pwsh.exe . For a while this was called PowerShell Core.

Starting with PowerShell 7, the "Core" naming is dropped. "PowerShell" is meant to refer this cross-platform open source version that continues to be in development.

Windows PowerShell is not under development since 5.1 except for maybe security fixes.


To my understanding PowersSell Core is also not as developed as 5.1

Generally speaking it's the opposite. All new development is happening in what was called "Core".

But when it first came out, it was missing some functionality on Windows for a variety of reasons:

  • .NET Core did not support all the Windows functionality that .NET Framework did
  • Some features relied on closed source, Windows platform-specific features
  • Many binary modules (especially the really popular ones related to Microsoft products like Active Directory) were themselves written in .NET Framework and couldn't be ported easily, or relied on components of the Windows products themselves to operate.

A lot has been done to work on that, so that has become less and less of an issue. There's also been workarounds like the module that uses PowerShell remoting from pwsh into a Windows system to execute the modules that way.


As for what you should learn? Both, especially for infosec.

One thing to keep in mind is that Windows PowerShell comes out of the box in all modern Windows versions, and at least for now, you have to install the other versions.

But again all new development, new features, etc. is really happening in the cross-platform version.

The language itself is not much different between versions and should be fairly easy to understand, as long as you keep an eye on the version drop down when looking at documentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM