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

Windows PowerShell 5.1


Windows PowerShell 5.1 is the latest, and probably last, version of Windows PowerShell, and is therefore of special interest in Windows environments. All operating systems with Windows 10 or Windows Server 2016 and higher come with the latest PowerShell version integrated. But, as you know, in many enterprise environments, you will always find machines with legacy operating systems, which may come with completely different versions.

One of the most important recommendations is to always use the most recent versions. PowerShell is backward-compatible, and therefore you should install Windows PowerShell 5.1 on all your machines, barring those known to be incompatible. This can be achieved with the previously described Windows Management Framework.

Because Windows PowerShell is built on top of the .NET Framework, you will need to have .NET version 4.5.2 installed on all computers before applying WMF 5.1 to them. There have been some issues with previous Windows Management Framework versions, which needed the consecutive installation of all of them, but these have been fixed in the latest version (5.1). So, having .NET Framework 4.5.2 installed on the computers is the only dependency you must fulfill.

Supported Operating Systems:

  • Windows Server 2012 R2
  • Windows Server 2012
  • Windows Server 2008 R2 SP1
  • Windows 8.1
  • Windows 7 SP1

Windows Management Framework 5.1 includes updates to Windows PowerShell, WindowsPowerShell Desired State Configuration (DSC), Windows Remote Management (WinRM), and Windows Management Instrumentation (WMI).

Note

PowerShell version 5.1 should be backward-compatible in most cases, but there are some known issues—for example, with Exchange Server 2010. A recommendation is to deploy the WMF 5.1 in waves and revalidate any existing scripts for possible issues after the upgrade.

There are different WMF 5.1 packages available for different operating systems:

If you have a distribution system in place, such as System Center Configuration Manager, you can easily deploy WMF 5.1 to all your machines. Alternatively, you can also accomplish this task through PowerShell remoting and command-line execution.