Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
DEVOPS & AUTOMATION Use tools to create
consistency in your scripts; an insiders’ guide
Jeff Wouters | Methos
DEVOPS & AUTOMATION
Jeff Wouters
CTO @ MethosMVP Cloud & Datacenter Management
MCT (PowerShell / DSC / Azure Automation)MSc | MBA | PhD
DEVOPS & AUTOMATION Agenda
• Plaster • VSCode• Pester• PSScriptAnalyzer• PSCodeHealth
DEVOPS & AUTOMATION Plaster
• Template-based file & project generator• Streamline module/test/dsc/… creation
• Yeoman for the PowerShell community
DEVOPS & AUTOMATION VSCode
• PowerShell extension• Integration with PSScriptAnalyzer
DEVOPS & AUTOMATION Pester
• Unit testing• Operation Validation Framework (OVF)• Module Manifests
• …anything?
DEVOPS & AUTOMATION Pester
Synopsis = not Null or EmptyDescription = not Null or EmptyParameters descriptions = not Null or EmptyParam count in Help = count in ASTExamples count –gt 0Notes contain: Author, Company, Customer
DEVOPS & AUTOMATION PSScriptAnalyzer
• Test for bad-practices.• Custom rules
• ...fix issues automatically?
DEVOPS & AUTOMATION PSScriptAnalyzer
AvoidAliasAvoidUsingPlainTextForPasswordMisleadingBacktickMissingModuleManifestFieldUseToExportFieldsInManifest
DEVOPS & AUTOMATION PSCodeHealth (Mathieu Buisson)
• Cyclomatic complexity* possible execution paths
DEVOPS & AUTOMATION PSCodeHealth (Mathieu Buisson)
• Code length• Code complexity• Bad practices• Tests and test coverage• Comment-based help
• Code smells• Styling issues
DEVOPS & AUTOMATION PSCodeHealth (Mathieu Buisson)
DEVOPS & AUTOMATION Metrics foreach function
• LinesOfCode• ScriptAnalyzerFindings• ContainsHelp• TestCoverage• CommandsMissed• Complexity
DEVOPS & AUTOMATION Metrics overall
Files (*.ps*1, excl tests)ComplexityAverageComplexityHighestFunctionsWithoutHelpLinesOfCode (Total/Avg.)PSSA (Total/Errors/Warnings/Info/Avg.)Tests (Failed/Passed/PassRate/Coverage
FunctionsNumberOfTestsCommandsMissedTotalNestingDepthAverageNestingDepthHighest
DEVOPS & AUTOMATION
DEVOPS & AUTOMATION
DEVOPS & AUTOMATION Do you want to gain more
knowledge about Microsoft technology?
The Future Ready Skills program offers online courseware, online labs, live Q&A’s and expert sessions, so you can acquire your official Microsoft Certificate in the most efficient way.
For more information:
aka.ms/frsblog
FUTURE READY SKILLS
DEVOPS & AUTOMATION
No more sessions, only drinks! (and traffic...)