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

PowerShell repository


Creating your own PowerShell repository is, fortunately, not that hard. In order to create a simple testing environment with an Active Directory domain, a public key infrastructure, a SQL server and a web server, we are using the AutomatedLablab framework and a machine running Hyper-V. The framework can also use Azure or VMware. This environment more closely resembles an actual enterprise infrastructure.

Note

For a local testing guide without any infrastructure, see: https://github.com/NuGet/NuGetGallery. The readme.md on the main page explains the basic steps.

While setting up the gallery this way requires the Windows operating system and the full .NET Framework, other NuGet Galleries might have different prerequisites.

In order to build a lab environment to test in, the following script can be used. It will require the Windows Server 2016 ISO as well as SQL Server 2017 as an ISO file:

$labName = 'NugetLab'

# Create a new lab definition - use your favorite hypervisor
New...