use tools to create consistency in your scripts - an …...your official microsoft certificate in...
TRANSCRIPT
![Page 1: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/1.jpg)
DEVOPS & AUTOMATION Use tools to create
consistency in your scripts; an insiders’ guide
Jeff Wouters | Methos
![Page 2: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/2.jpg)
DEVOPS & AUTOMATION
Jeff Wouters
CTO @ MethosMVP Cloud & Datacenter Management
MCT (PowerShell / DSC / Azure Automation)MSc | MBA | PhD
![Page 3: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/3.jpg)
DEVOPS & AUTOMATION Agenda
• Plaster • VSCode• Pester• PSScriptAnalyzer• PSCodeHealth
![Page 4: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/4.jpg)
DEVOPS & AUTOMATION Plaster
• Template-based file & project generator• Streamline module/test/dsc/… creation
• Yeoman for the PowerShell community
![Page 5: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/5.jpg)
DEVOPS & AUTOMATION VSCode
• PowerShell extension• Integration with PSScriptAnalyzer
![Page 6: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/6.jpg)
DEVOPS & AUTOMATION Pester
• Unit testing• Operation Validation Framework (OVF)• Module Manifests
• …anything?
![Page 7: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/7.jpg)
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
![Page 8: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/8.jpg)
DEVOPS & AUTOMATION PSScriptAnalyzer
• Test for bad-practices.• Custom rules
• ...fix issues automatically?
![Page 9: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/9.jpg)
DEVOPS & AUTOMATION PSScriptAnalyzer
AvoidAliasAvoidUsingPlainTextForPasswordMisleadingBacktickMissingModuleManifestFieldUseToExportFieldsInManifest
![Page 10: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/10.jpg)
DEVOPS & AUTOMATION PSCodeHealth (Mathieu Buisson)
• Cyclomatic complexity* possible execution paths
![Page 11: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/11.jpg)
DEVOPS & AUTOMATION PSCodeHealth (Mathieu Buisson)
• Code length• Code complexity• Bad practices• Tests and test coverage• Comment-based help
• Code smells• Styling issues
![Page 12: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/12.jpg)
DEVOPS & AUTOMATION PSCodeHealth (Mathieu Buisson)
![Page 13: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/13.jpg)
DEVOPS & AUTOMATION Metrics foreach function
• LinesOfCode• ScriptAnalyzerFindings• ContainsHelp• TestCoverage• CommandsMissed• Complexity
![Page 14: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/14.jpg)
DEVOPS & AUTOMATION Metrics overall
Files (*.ps*1, excl tests)ComplexityAverageComplexityHighestFunctionsWithoutHelpLinesOfCode (Total/Avg.)PSSA (Total/Errors/Warnings/Info/Avg.)Tests (Failed/Passed/PassRate/Coverage
FunctionsNumberOfTestsCommandsMissedTotalNestingDepthAverageNestingDepthHighest
![Page 15: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/15.jpg)
DEVOPS & AUTOMATION
DEVOPS & AUTOMATION
![Page 16: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/16.jpg)
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
![Page 17: Use tools to create consistency in your scripts - an …...your official Microsoft Certificate in the most efficient way. For more information: aka.ms/frsblog FUTURE READY SKILLS DEVOPS](https://reader033.vdocuments.us/reader033/viewer/2022050608/5faefb70aedc4c1c0736dff1/html5/thumbnails/17.jpg)
DEVOPS & AUTOMATION
No more sessions, only drinks! (and traffic...)