Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

PowerShell from *nix user perspective

1,736 views

Published on

Introduction to PowerShell from perspective of unix user. Some interesting tips for PoweShell users and pointers to open source resources.

Published in: Technology
  • Be the first to comment

PowerShell from *nix user perspective

  1. 1. PowerShell from *nix user perspective Juraj Michálek – http://georgik.sinusgear.com 2. 10. 2013 EurOpen.CZ – Vranov nad Dyjí
  2. 2. Examples @github https://github.com/georgik/powershell-examples
  3. 3. Where's the difference?
  4. 4. Minimalistic approach? After installing some Windows updates...
  5. 5. Change font size
  6. 6. Copy & paste text Click & drag to select, Enter to copy to clipboard Right click to paste
  7. 7. Multi-line selection?
  8. 8. PowerShell ISE
  9. 9. ConEmu http://code.google.com/p/conemu-maximus5/
  10. 10. Text selection Default: Shift+Click to mark and copy
  11. 11. Zoom In/Out CTRL + mouse wheel PowerShell ISE ConEmu
  12. 12. Commands from CMD.EXE works
  13. 13. Unix like commands
  14. 14. Cmdlets
  15. 15. Get-Command
  16. 16. Useful shortcuts TAB – complete/expand/suggest Shift+Tab – previous hint/suggestion CTRL+C – cancel current line Up/Down – navigate in history
  17. 17. Get-Help
  18. 18. Get-Help -online
  19. 19. Redirect output to file > Note: output files are in unicode (double characters)
  20. 20. Pipe |
  21. 21. cd
  22. 22. networkpath
  23. 23. Mathematics
  24. 24. Variables
  25. 25. Write-Host
  26. 26. Output of cmdlet to variable
  27. 27. Foreach
  28. 28. Special variables $_ - instance piped into command $? - true/false – success of last command $args – parameters for function $HOME – user's home $LASTEXITCODE – exit code of last process
  29. 29. Compare
  30. 30. For ` indicates that command will continue on next line
  31. 31. *-Service
  32. 32. Array [ ]
  33. 33. Get-Member E.g.: Get-Command calc | Get-Member (Get-Command calc).Path
  34. 34. Select-String
  35. 35. -whatif
  36. 36. -confirm
  37. 37. Get-ChildItem – find files In case of long file path: | Select-Object -ExpandProperty FullName >file-list.txt
  38. 38. Get-ChildItem registry
  39. 39. Out-GridView
  40. 40. Get-WmiObject http://msdn.microsoft.com/en-us/library/windows/desktop/aa394084(v=vs.85).aspx
  41. 41. Stop and delete service
  42. 42. Start-up configuration ~DocumentsWindowsPowerShell Microsoft.PowerShell_profile.ps1
  43. 43. Execution policy
  44. 44. Sample profile
  45. 45. PowerShell Integrated Script Environment
  46. 46. PowerShell 3 ISE
  47. 47. ISE + .Net F5 – Run script
  48. 48. Run Selection F8 – Run selection
  49. 49. Debugging F9 – Toggle break point
  50. 50. Direct printer simulator
  51. 51. PowerGUI http://www.powergui.org
  52. 52. Examples @github https://github.com/georgik/powershell-examples
  53. 53. Resources PowerShell 3 http://social.technet.microsoft.com/wiki/contents/articles/4725.powershell-v3-guide-en-us.aspx PowerShell tips http://technet.microsoft.com/en-us/library/hh848797.aspx Cheat Sheet http://www.cheat-sheets.org/#WindowsPowerShell PowerShell Books http://powershellbooks.com/ Wiki http://wiki.ysoft.local/display/RnD - How To PowerShell
  54. 54. Juraj Michálek 2. 10. 2013

×