Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PowerShell: Bringing DevOps to Windows

PowerShell: Bringing DevOps to Windows

An introduction to the foundations and possibilities of PowerShell! As presented at Abstractions.io.

Kevin Berridge

August 19, 2016
Tweet

More Decks by Kevin Berridge

Other Decks in Programming

Transcript

  1. Basic Shell Commands and Aliases PowerShell Command PowerShell Alias DOS

    Equivalent Unix Equivalent Set-Location sl cd* cd* Get-ChildItem gci dir* ls* Copy-Item cpi copy* cp* Move-Item mi move* mv* Remove-Item ri del* rm* Get-Content gc type* cat* Get-Help help help* man*
  2. Summary • Aliases are nice because they are short, also

    they match what you already know • Tab key auto completion is wonderful • The help command will teach you what you need to know
  3. Main Pipeline Commands • ForEach-Object (%) • Where-Object (?) •

    Sort-Object (sort) • Select-Object (select)
  4. Summary • Commandlets return objects • DOS command return strings

    • “|” lets you easily chain commands together over those objects • Get-Member will tell you what those objects can do • %, ?, sort, select
  5. PowerShell C# -eq == -ne != -gt > -ge >=

    -lt < -le <= -like Regex -notlike -match -contains Linq
  6. Summary • Scripts are no different than the shell! •

    $variables • Use functions just like commandlets • Comparison operators • & and Invoke-Expression • $lastexitcode vs. exceptions • PSAKE: make for PowerShell
  7. Summary • PowerShell is a .NET language • You can

    use anything in .NET from PowerShell
  8. Honorable Mentions •PowerShell Remoting SSH for Windows! •PS Read Line

    Better editing at the shell! •Set-PSBreakpoint Integrated debugging! •Desired State Configuration (DSC) Chef/Puppet for PowerShell!