Book Image

Learn PowerShell Core 6.0

By : David das Neves, Jan-Hendrik Peters
Book Image

Learn PowerShell Core 6.0

By: David das Neves, Jan-Hendrik Peters

Overview of this book

Beginning with an overview of the different versions of PowerShell, Learn PowerShell Core 6.0 introduces you to VSCode and then dives into helping you understand the basic techniques in PowerShell scripting. You will cover advanced coding techniques, learn how to write reusable code as well as store and load data with PowerShell. This book will help you understand PowerShell security and Just Enough Administration, enabling you to create your own PowerShell repository. The last set of chapters will guide you in setting up, configuring, and working with Release Pipelines in VSCode and VSTS, and help you understand PowerShell DSC. In addition to this, you will learn how to use PowerShell with Windows, Azure, Microsoft Online Services, SCCM, and SQL Server. The final chapter will provide you with some use cases and pro tips. By the end of this book, you will be able to create professional reusable code using security insight and knowledge of working with PowerShell Core 6.0 and its most important capabilities.
Table of Contents (26 chapters)
Title Page
Dedication
Packt Upsell
Contributors
Preface
Index

Overview of different versions of Powershell


To provide the best overview, we will focus on the most valuable information. First, you need to know about the two different versions and the differences between them.

PowerShell Editions 

There are two editions of PowerShell:

  • Desktop Edition: This version uses the full .NET CLR. It is primarily used in Windows Desktop and Core Server environments.
  • Core Edition: This version uses .NET Core. It is primarily used in Windows IoT and Nano Server environments.

The $PSVersionTable variable holds the information for the currently used PSVersion and PSEdition.

The same terminology can be observed with Windows PowerShell versus PowerShell Core:

  • Windows PowerShell is built on top of the .NET Framework:
    • Versions 1 to 5.1
    • Available on Windows and Windows Server only
    • Delivered as a built-in component and via WMF
    • Built on top of the .NET Framework (also known as FullCLR)
    • $PSVersionTable.PSEdition is set to Desktop
  • PowerShell Core is built on top of .NET Core:
    • Version 6++ (and Nano Server/Windows 10 IoT)
    • Available on Windows, macOS, and Linux
    • Delivered via MSI, ZIP, or PKG (macOS)
    • Built on top of the current .NET Core version (also known as CoreCLR)
    • $PSVersionTable.PSEdition is set to Core

PowerShell Core is available in Windows Server 2016 Nano Server and Windows 10 IoT, but also in PowerShell Core 6 and newer versions.

This information brings us to the following overview: