Learning PowerShell DSC
eBook - ePub

Learning PowerShell DSC

  1. 268 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning PowerShell DSC

Book details
Book preview
Table of contents
Citations

About This Book

Get started with the fundamentals of PowerShell DSC and utilize its power to automate deployment and configuration of your servers

About This Book

  • Create flexible and maintainable deployments using DSC configuration scripts that stand the test of time
  • Explore the in depth details of the core architecture, concepts, and practices used by PowerShell DSC
  • A step-by-step guide that shows you how to start using and taking advantage of PowerShell DSC

Who This Book Is For

This book is intended for system administrators, developers, or engineers who are responsible for configuration management and automation and wish to learn PowerShell Desired State Configuration for efficient management, configuration and deployment of systems and applications.

What You Will Learn

  • Understand configuration management and why you need it
  • Craft flexible, reusable, and maintainable configuration scripts for thousands of servers
  • Create custom DSC resources to manage any application or server setting
  • Apply configuration data to deploy applications to different environments
  • Utilize DSC push deployments to test your configuration scripts and custom DSC resources
  • Install, configure and use DSC pull servers
  • Run a Windows MSI package
  • Deploy a website

In Detail

Windows PowerShell is a task-based command-line shell and scripting language designed especially for system administration. PowerShell DSC is a new management platform that enables you to deploy and manage configuration data for software services and manage the environment in which these services run.

This book begins with an overview of the basics of PowerShell DSC by covering the architecture and components of the Desired Sate Configuration. It will then familiarize you with the set of PowerShell language extensions and new PowerShell commands. It will help you understand and create DSC configurations with the help of practical examples, and to create DSC custom resources for your custom applications. Finally, you will learn to deploy a real world application using PowerShell DSC. By the end of the book, you will have better knowledge about the powerful Desired State Configuration platform, which helps you to achieve continuous delivery, and efficient management and easy deployment of data for systems.

Style and approach

This book is an in-depth guide to using PowerShell DSC, full of real-world experiences and best practices using PowerShell DSC. The topics are explained and build on one another other to provide a holistic learning experience. At the end, all the features learned will be used to create a real world application deployment using DSC.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Learning PowerShell DSC by James Pogran in PDF and/or ePUB format, as well as other popular books in Computer Science & Computer Networking. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781783980703
Edition
1

Learning PowerShell DSC


Table of Contents

Learning PowerShell DSC
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Instant updates on new Packt books
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Introduction to PowerShell DSC
What is PowerShell DSC?
What is PowerShell?
On to PowerShell DSC
Why do we need Configuration Management?
What is DevOps?
DSC quick wins
A high level overview of DSC
The authoring phase
The staging phase
The execution phase
Why all the abstraction?
How does DSC help me?
The who
The what
The how
Idempotence
Isn't this Group Policy or SCCM?
DSC features
DSC requirements
DSC versions
PowerShell v4 DSC
v4 DSC language extensions
v4 DSC base resources
v4 DSC Cmdlets
The v4 DSC Pull Server
PowerShell v5 DSC
v5 DSC language extensions
v5 DSC base resources
v5 DSC Cmdlets
v5 improvements
The PowerShell ISE
Partial configurations and dependencies
Class-based DSC Resources
DSC built-in support for help
DSC run as credential support
DSC resource side-by-side installation
DSC resource script debugging
The separation of node and configuration IDs
DSC LCM MetaConfig updates
DSC LCM rich state information
DSC LCM RefreshMode values
DSC status from a central location
Summary
2. DSC Architecture
Overview
Push and pull modes
The push management model
The pull management model
The general workflow
Authoring
Syntax
Compilation
Staging
Execution
Push executions
Pull executions
The example workflow
Configuration data
Hardcoded data
Parameter-based data
Hashtable data
Local Configuration Manager
LCM settings
Configuration modes
ApplyOnly
ApplyAndMonitor
ApplyAndAutoCorrect
Refresh modes
The LCM configuration
An example LCM configuration
The DSC Pull Server
What is a DSC Pull Server?
What does the Pull Server do for us?
Automatic and continuous configuration
Repository
Reporting
Security
Setting up a DSC Pull Server
Pull Server settings
Installing the DSC server
Adding MOF files to a Pull Server
Adding DSC Resources to a Pull Server
Deployment considerations
General observations
LCM gotchas
Deployment mode differences
Summary
3. DSC Configuration Files
Defining a DSC configuration script file
Authoring DSC configuration files
DSC automatic variables
AllNodes
Node
ConfigurationData
DSC Resource import declarations
Import-DscResource
The DSC script file syntax
The Configuration keyword
The Node keyword
DSC Resource statements
The script file example
Defining a DSC configuration data file
Authoring DSC configuration data files
Configuration data syntax
The variable syntax
The data file syntax
Allowable DSC configuration content
Creating reusable DSC configurations
Nested DSC configurations
Nested DSC configuration syntax
Nested DSC configuration limitations
DSC composite resources
Why use DSC composite resources?
The DSC composite resource syntax
DSC composite resource folder structure
DSC composite resource drawbacks
Debugging and troubleshooting configuration script files
Using DSC event logs
Enabling verbose logging
What do DSC event logs contain?
Gathering events from a single DSC operation
Event Viewer
PowerShell
Using the xDscDiagnostics module to analyze DSC logs
Get-xDscOperation
Trace-xDscOperation
Resetting the DSC engine cache
Enabling the debug mode
Fixing a stuck DSC run
Summary
4. DSC Resources
What are DSC Resources?
Creating a custom PowerShell v4 DSC Resource
The folder structure of a v4 DSC Resource
The syntax of a v4 DSC Resource
The DSC Resource definition file
Naming
Versioning
Parameters
Qualifiers
The DSC PowerShell module file
Get-TargetResource
Test-TargetResource
Set-TargetResource
Authoring custom DSC Resources
Creating DSC Resources manually
Creating DSC Resources automatically
Creating a custom PowerShell v5 DSC Resource
PowerShell classes
Class-based DSC Resources
The folder structure of v5 DSC Resources
The syntax of v5 DSC Resources
Declaring the class
Schema
Methods
Get
Test
Set
The advantages of a class-based DSC Resource
The disadvantages of a class-based DSC Resource
What makes a good DSC Resource
Idempotent
Do one thing well
Reuse code, but don't go overboard
Contribute back!
Testing custom DSC Resources
Using xDscResourceDesigner
Pester
Microsoft recommendations
How do you find DSC Resources?
Microsoft DSC Resource Kits
Installing DSC Resource Kits
The Microsoft PowerShell DSC GitHub repository
Installing DSC Resources from GitHub
The Microsoft PowerShell Gallery
PackageManagement
Installing PackageManagement
Initializing PackageManagement
Discover DSC Resources in the PowerShell Gallery
Installing DSC Resources in the PowerShell Gallery
Custom hosting options
Local SMB/network share
NuGet IIS
Third-party NuGet servers
Summary
5. Pushing DSC Configurations
Tooling
Setting things up
Test environments
Locally pushing DSC configurations
Setting up the test environment locally
Compiling configurations for local target nodes
Executing configurations for local target nodes
Remotely pushing DSC configurations
Setting up the test environment remotely
Compiling configurations for remote target nodes
Executing configurations for remote target nodes
Things you must consider when pushing DSC configurations
Summary
6. Pulling DSC Configurations
Creating DSC Pull Servers
DSC Pull Server setup considerations
DSC Pull Server types
The Windows Management Framework version
Initial setup tasks
Installing required DSC Resources
SSL certificates
SMB share creation
Preparing DSC Resources for Pull Server distribution
Miscellaneous tasks
Creating a WMF 4 DSC Pull Server
Creating a WMF 5 DSC Pull Server
Validating a DSC Pull Server install
Testing using a web browser
Testing using the command line
Registering target nodes with a DSC Pull Server
Registering a WMF 4 target node
Registering a WMF 5 target node
Pulling DSC configurations with a DSC Pull Server
Pulling DSC configurations using ConfigurationIDs
Pulling DSC configurations using RegistrationKeys
DSC Pull...

Table of contents

  1. Learning PowerShell DSC