Windows PowerShell Desired State Configuration Revealed.pdf

(11847 KB) Pobierz
www.it-ebooks.info
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
www.it-ebooks.info
Contents at a Glance
About the Author �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
xv
About the Technical Reviewer �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
xvii
Acknowledgments �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
xix
Introduction �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
xxi
Part I: Introduction to Windows PowerShell �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
1
Chapter 1: Beginning Windows PowerShell�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½3
Chapter 2: Introducing Windows Remote Management and CIM �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½43
Part II: Desired State Configuration Essentials�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
75
Chapter 3: Introducing Desired State Configuration �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½77
Chapter 4: Getting Started with DSC�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½91
Chapter 5: Using Built-in DSC Resources �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½113
Chapter 6: Building Advanced DSC Configurations �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½151
Part III: Advanced DSC Concepts and Tips�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
177
Chapter 7: DSC Configuration Delivery Modes�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½179
Chapter 8: Monitoring, Correcting, and Reporting Configuration �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½207
Chapter 9: Building Custom DSC Resources �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½223
v
www.it-ebooks.info
Contents at a GlanCe
Chapter 10: Troubleshooting Common DSC Issues �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½247
Chapter 11: DSC—From the Field �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½257
Appendix A: DSC Community Resources �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½269
Appendix B: WMF 5�½0 and DSC for Linux �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½277
Index �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½285
vi
www.it-ebooks.info
Introduction
About the beginning of this year, Gwenan Spearing (at Apress) approached me to see if I was interested in writing a
book on Desired State Configuration (DSC). I couldn’t say no, because after Windows PowerShell remoting and
WMI/CIM, DSC has been my favorite subject. I have been writing and speaking about DSC since the first preview
came out in 2013, and there is no better way to capture that experience than in a book such as this.
Over last few years, IT service processes at various organizations, small and large, have been gearing up to
support the Agile development and release cycles. It is no longer about how many features a product gains with every
release cycle, but it is about how fast those features are delivered. As system administrators, developers, and DevOps
engineers, you must have been experiencing this already. There are several tools and/or frameworks developed
to support continuous delivery and configuration management in a data center. This is not a new subject, but it is
certainly an area that is still evolving. There is no standard way of achieving your goals through these frameworks.
Microsoft, with its Cloud OS vision, has been focusing on building tools that enable developers and IT
professionals alike to build and manage cloud infrastructure. One such initiative is Desired State Configuration.
DSC is a configuration standards-based management platform rather than a tool. DSC supports both Windows and
Linux platforms. By
management platform,
we mean that the Application Programming Interfaces (API) provided by
DSC can be used within any programming language, to manage configuration of devices and applications in a data
center. This book provides an example of how these interfaces are used within PowerShell. While this book focuses
on DSC with PowerShell, the concepts that you learn here can easily be leveraged in any programming or scripting
language that has support for accessing DSC API. I have included several examples in each chapter, to build a greater
understanding of the concepts. These examples do not require any special infrastructure. All that’s required is just a
couple of virtual machines.
An Overview of This Book
Windows PowerShell Desired State Configuration Revealed
is divided into three distinct parts. Each part contains
related chapters that help you to understand thoroughly the concepts that are covered.
Part I: Introduction to Windows PowerShell
Part I provides an overview of Windows PowerShell as an automation engine and scripting language. It also includes
a survey of Windows Remote Management (WinRM) and the Common Information Model (CIM).
Chapter 1: Beginning Windows PowerShell
This chapter introduces Windows PowerShell to beginners. The examples featured in this book require that you
understand PowerShell, and it is necessary that you know the key PowerShell concepts, to make good use of the
content of this book. For beginners, this chapter provides an overview that explains what PowerShell is, the need for
PowerShell, the semantics of the PowerShell scripting language, and writing scripts, functions, and modules. Readers
experienced with the key concepts of Windows PowerShell may choose to skip this chapter.
xxi
www.it-ebooks.info
Zgłoś jeśli naruszono regulamin