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

Bringing it all together


With all the components introduced, we can use the template structure for our module development:

  • ModuleName\Public
    • Contains all publicly visible module functions
    • Each function is in a separate script, called NameOfFunction.ps1
  • ModuleName\Private
    • Contains all internally visible functions
    • Each function is in a separate script, called NameOfFunction.ps1
  • ModuleName\Types
    • Contains all .NET/PowerShell classes the module requires
  • ModuleName\ModuleName.psm1
    • Your script module
  • ModuleName\ModuleName.psd1
    • Your module manifest
  • Test
    • Contains all unit and integration tests to execute, possibly sorted into subfolders
    • Usually one *.Test.ps1 file per function
  • ModuleName.psdeploy.ps1
  • appveyor.yml
  • build.ps1
  • psake.ps1
  • README.md
  • LICENSE

As the central entry point, the build script kicks off your deployment process. We like to use Psake and PSDeploy, but you can also simply use your build script to create a Nuget package, execute tests, and so on. As an example, AutomatedLab.Common—a module collecting helper...