+ All Categories
Home > Documents > Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... ·...

Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... ·...

Date post: 03-Jul-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
22
AUTOMATION Create and troubleshoot your own DSC building blocks and “Make it so!” Ben Gelens
Transcript
Page 1: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

Create and troubleshoot

your own DSC building

blocks and “Make it so!”

Ben Gelens

Page 2: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

Ben GelensJob : Consultant

MVP : CDM (PowerShell)

Company : inovativ

Email : [email protected]

GitHub : bgelens

Twitter : @bgelens

Community : {Hyper-V.nu, azurestack.eu, DuPSUG}

Blogging : {Hyper-V.nu, PowerShellMagazine.com, azurestack.eu}

Page 3: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

Agenda

• Overview resources

• Inbox Script Resource

• Custom Script Resource Module

• Custom Class Resource Module

• Summary

Page 4: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

DSC Resources

• Inbox

• Registry

• File

• Script

• ….

• Resource Kit (x and HQRM)

• Custom / Homebrew

Page 5: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION Inbox Resources

Page 6: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

Inbox now OSS: PSDscResources

https://github.com/PowerShell/PSDscResources

Page 7: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

Resource Kit PSGallery

Page 8: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

Resource Kit GitHubhttps://github.com/PowerShell/DscResources

Page 9: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

Script Resource

Page 10: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

Bad examples all over the place

E.g. Look in Azure Template GitHub repo

Page 11: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

Is this any good?

Page 12: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

Page 13: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION Custom Script Resource Module

Module Directory

Version

Manifest

Resources Directory

DSC ResourceResource Code

and MOF Schema

Page 14: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

Schema.mof

Resource Code:

• Get

• Set

• Test

Reboot Required?

Page 15: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATIONAUTOMATION

Demo:

Script Resource Module

Page 16: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION Custom Class Resource Module

Module Directory

Version

ManifestResources

WMF 5+!

Page 17: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

Resource Code:

• Get

• Set

• Test

No Schema!

Generated on the fly

Page 18: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATIONAUTOMATION

Demo:

Class Resource Module

Page 19: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

Combined Script and Class

• New in WMF5.1

• Class and script resources co-exist in

same “Parent” module

• No downlevel support

Page 20: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

Summary

• Use inbox -> Resource Kit -> Custom Resource

• Make attempt to contribute your custom resource

to community (IP won’t make DSC better!)

• Only Use Script Resource for Q&D if you can

• Use Script Resource Module if WMF4 can be targeted

• Use Class Resource Module for new tech

• Use Pester Unit and Integration Tests for higher Quality

• Combined script and class resources for WMF5.1+ only

Page 21: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

Summary• Debug

• Import psm1

• Verbose!

• own user credentials

• best for Unit testing

• LCM Debugging

• Debugger

• Runs as system

• Step by step tracking

Page 22: Create and troubleshoot your own DSC buildingexpertslive.nl/wp-content/uploads/2016/12/Ben... · E.g. Look in Azure Template GitHub repo. AUTOMATION Is this any good? AUTOMATION.

AUTOMATION

<Volgende sessie 16:00 – 17:00 uur>

Premium Management and Protection of Identity and Access with Azure AD (EN)

Jan Vidar Elven


Recommended