Pro Yearly is on sale from $80 to $50! »

PowerShell, Visual Studio Code & Git for the reluctant IT Pro

PowerShell, Visual Studio Code & Git for the reluctant IT Pro

9768eea42c648fc1dcd190e924deb59c?s=128

Thomas Vochten

November 14, 2018
Tweet

Transcript

  1. Office 365 & SharePoint Connect 2018 | @thomasvochten IT Pro

    • Level 200
  2. None
  3. Thomas Vochten Microsoft MVP. Solution architect Office 365 & SharePoint.

    Technical Evangelist. @thomasvochten https://thomasvochten.com mail@thomasvochten.com
  4. Agenda • PowerShell past, present & future • Essential PowerShell

    modules & configuration • Working with Visual Studio Code • Getting started with git • Leverage the power of the community
  5. Why exactly would I care?

  6. Not just for developers Decent Tooling Source Control

  7. The inconvenient truth… PowerShell is code too!

  8. Why PowerShell? Many tasks are only available in PowerShell &

    Avoiding repetition should be a life goal
  9. PowerShell past, present & future

  10. PowerShell is open source https://github.com/PowerShell

  11. PowerShell • The old and trusted • .NET Framework •

    Windows only • powershell.exe • versions 1.0 > 5.1 • continues to be supported PowerShell Core • The new kid on the block • .NET Core • Cross-platform • pwsh.exe • version 6 and beyond • the way forward
  12. PowerShell Core is upon us! •PowerShell Core 6.0 was released

    in January of 2018 •Currently at version 6.1.1 •Cross-platform: Windows, macOS and Linux sudo apt-get install powershell
  13. PowerShell Core

  14. Windows PowerShell

  15. PowerShell strategy, modules & configuration

  16. Don’t be an ad hoc scripter that only solves problems

    when they arise
  17. Have a toolbox! Aim for a modular approach with •

    Reusable tools • Predictable outcome • Single responsibility
  18. Modules 101 Download manually or use the PowerShell Gallery https://www.powershellgallery.com

    Find-Module Install-Module Update-Module Get-Module
  19. Default Module Locations %userprofile%\Documents\WindowsPowerShell\Modules C:\Program Files\WindowsPowerShell\Modules C:\Windows\system32\WindowsPowerShell\v1.0\Modules

  20. Essential modules for tool-making Plaster Template-based file and project generator

    Pester Testing framework
  21. Demo Working with PowerShell modules, plaster & pester

  22. Working with Visual Studio Code

  23. PowerShell editors Visual Studio Code the new hotness PowerShell ISE

    deprecated https://code.visualstudio.com
  24. Why Visual Studio Code? • Intellisense • Debugging • Script

    Analysis • Built-in git support • Cross-platform • Open source • Highly customizable • Powerful extensions model
  25. Must Have: PowerShell Extension

  26. Basic tweaks & customizations • Install extensions • PowerShell •

    EditorServicesCommandSuite tip • Configure settings such as color scheme • Configure snippets • Add the SharePoint Server “stubs” https://thvo.me/spstubs (Spencer Harbar) • Use a PowerShell profile!
  27. Demo Visual Studio Code - essential tweaks & customizations, debugging

  28. Getting started with git

  29. Git is a free and open source distributed version control

    system https://git-scm.com (*) Git is not the same as GitHub, you can host git in Azure DevOps or just use it on your machine only…
  30. https://ohshitgit.com/

  31. Git integration with Visual Studio • Separate download & install

    • Integrated in Visual Studio Code • Supports most basic git commands • Commandline for more advanced scenario’s
  32. Complementing your toolbox Cmder Open source console emulator Git &

    Linux commands integration http://cmder.net Posh-git PowerShell module for git integration in PowerShell Install-module posh-git
  33. Basic git scenario’s • Just “downloading” code from the internet

    (cloning) • Creating your own version of the code (forking) • Checking in your changes (commiting) • Updating your copy with changes from the source (fetch & merge)
  34. Demo Git - Essentials

  35. What to learn next? 1. Branching 2. Working with remote

    repositories 3. Creating pull requests 4. Merging your branch
  36. Leverage the power of the community!

  37. Sharing is caring! Everyone can contribute • Share the things

    you’re proud of • PowerShell scripts & modules • Samples and tutorials • Documentation • …
  38. Contributing with git • Fork the repo you want to

    contribute to • Create a branch for your change • Make & test your changes • Create a pull request • Wait for the pull request to be accepted Learn about pull requests do’s & don’ts…
  39. @thomasvochten