22
AUTOMATION Create and troubleshoot your own DSC building blocks and “Make it so!” Ben Gelens

Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATION

Create and troubleshoot

your own DSC building

blocks and “Make it so!”

Ben Gelens

Page 2: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

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 building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATION

Agenda

• Overview resources

• Inbox Script Resource

• Custom Script Resource Module

• Custom Class Resource Module

• Summary

Page 4: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATION

DSC Resources

• Inbox

• Registry

• File

• Script

• ….

• Resource Kit (x and HQRM)

• Custom / Homebrew

Page 5: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATION Inbox Resources

Page 6: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATION

Inbox now OSS: PSDscResources

https://github.com/PowerShell/PSDscResources

Page 7: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATION

Resource Kit PSGallery

Page 8: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATION

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

Page 9: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATION

Script Resource

Page 10: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATION

Bad examples all over the place

E.g. Look in Azure Template GitHub repo

Page 11: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATION

Is this any good?

Page 12: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATION

Page 13: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

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 building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATION

Schema.mof

Resource Code:

• Get

• Set

• Test

Reboot Required?

Page 15: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATIONAUTOMATION

Demo:

Script Resource Module

Page 16: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATION Custom Class Resource Module

Module Directory

Version

ManifestResources

WMF 5+!

Page 17: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATION

Resource Code:

• Get

• Set

• Test

No Schema!

Generated on the fly

Page 18: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATIONAUTOMATION

Demo:

Class Resource Module

Page 19: Create and troubleshoot your own DSC building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

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 building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

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 building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

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 building...Premium Management and Protection of Identity and Access with Azure AD (EN) Jan Vidar Elven Title PowerPoint Presentation Author Taco

AUTOMATION

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

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

Jan Vidar Elven