Top Banner
PowerShell from *nix user perspective Juraj Michálek – http://georgik.sinusgear.com 2. 10. 2013 EurOpen.CZ – Vranov nad Dyjí
55

LibreOffice Presentation Template (Community) - EurOpen

Feb 09, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: LibreOffice Presentation Template (Community) - EurOpen

PowerShell from *nix user perspective

Juraj Michálek – http://georgik.sinusgear.com2. 10. 2013EurOpen.CZ – Vranov nad Dyjí

Page 2: LibreOffice Presentation Template (Community) - EurOpen

Examples @github

https://github.com/georgik/powershell-examples

Page 3: LibreOffice Presentation Template (Community) - EurOpen

Where's the difference?

Page 4: LibreOffice Presentation Template (Community) - EurOpen

Minimalistic approach?

After installing some Windows updates...

Page 5: LibreOffice Presentation Template (Community) - EurOpen

Change font size

Page 6: LibreOffice Presentation Template (Community) - EurOpen

Copy & paste text

Click & drag to select,Enter to copy to clipboard

Right click to paste

Page 7: LibreOffice Presentation Template (Community) - EurOpen

Multi-line selection?

Page 8: LibreOffice Presentation Template (Community) - EurOpen

PowerShell ISE

Page 9: LibreOffice Presentation Template (Community) - EurOpen

ConEmu

http://code.google.com/p/conemu-maximus5/

Page 10: LibreOffice Presentation Template (Community) - EurOpen

Text selection

Default: Shift+Click to mark and copy

Page 11: LibreOffice Presentation Template (Community) - EurOpen

Zoom In/Out

CTRL + mouse wheelPowerShell ISEConEmu

Page 12: LibreOffice Presentation Template (Community) - EurOpen

Commands from CMD.EXE works

Page 13: LibreOffice Presentation Template (Community) - EurOpen

Unix like commands

Page 14: LibreOffice Presentation Template (Community) - EurOpen

Cmdlets

Page 15: LibreOffice Presentation Template (Community) - EurOpen

Get-Command

Page 16: LibreOffice Presentation Template (Community) - EurOpen

Useful shortcuts

TAB – complete/expand/suggestShift+Tab – previous hint/suggestionCTRL+C – cancel current lineUp/Down – navigate in history

Page 17: LibreOffice Presentation Template (Community) - EurOpen

Get-Help

Page 18: LibreOffice Presentation Template (Community) - EurOpen

Get-Help -online

Page 19: LibreOffice Presentation Template (Community) - EurOpen

Redirect output to file >

Note: output files are in unicode (double characters)

Page 20: LibreOffice Presentation Template (Community) - EurOpen

Pipe |

Page 21: LibreOffice Presentation Template (Community) - EurOpen

cd

Page 22: LibreOffice Presentation Template (Community) - EurOpen

\\network\path

Page 23: LibreOffice Presentation Template (Community) - EurOpen

Mathematics

Page 24: LibreOffice Presentation Template (Community) - EurOpen

Variables

Page 25: LibreOffice Presentation Template (Community) - EurOpen

Write-Host

Page 26: LibreOffice Presentation Template (Community) - EurOpen

Output of cmdlet to variable

Page 27: LibreOffice Presentation Template (Community) - EurOpen

Foreach

Page 28: LibreOffice Presentation Template (Community) - EurOpen

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

Page 29: LibreOffice Presentation Template (Community) - EurOpen

Compare

Page 30: LibreOffice Presentation Template (Community) - EurOpen

For

` indicates that command will continue on next line

Page 31: LibreOffice Presentation Template (Community) - EurOpen

*-Service

Page 32: LibreOffice Presentation Template (Community) - EurOpen

Array [ ]

Page 33: LibreOffice Presentation Template (Community) - EurOpen

Get-Member

E.g.: Get-Command calc | Get-Member(Get-Command calc).Path

Page 34: LibreOffice Presentation Template (Community) - EurOpen

Select-String

Page 35: LibreOffice Presentation Template (Community) - EurOpen

-whatif

Page 36: LibreOffice Presentation Template (Community) - EurOpen

-confirm

Page 37: LibreOffice Presentation Template (Community) - EurOpen

Get-ChildItem – find files

In case of long file path: | Select-Object -ExpandProperty FullName >file-list.txt

Page 38: LibreOffice Presentation Template (Community) - EurOpen

Get-ChildItem registry

Page 39: LibreOffice Presentation Template (Community) - EurOpen

Out-GridView

Page 40: LibreOffice Presentation Template (Community) - EurOpen

Get-WmiObject

http://msdn.microsoft.com/en-us/library/windows/desktop/aa394084(v=vs.85).aspx

Page 41: LibreOffice Presentation Template (Community) - EurOpen
Page 42: LibreOffice Presentation Template (Community) - EurOpen

Stop and delete service

Page 43: LibreOffice Presentation Template (Community) - EurOpen

Start-up configuration

~\Documents\WindowsPowerShell\ Microsoft.PowerShell_profile.ps1

Page 44: LibreOffice Presentation Template (Community) - EurOpen

Execution policy

Page 45: LibreOffice Presentation Template (Community) - EurOpen

Sample profile

Page 46: LibreOffice Presentation Template (Community) - EurOpen

PowerShell Integrated Script Environment

Page 47: LibreOffice Presentation Template (Community) - EurOpen

PowerShell 3 ISE

Page 48: LibreOffice Presentation Template (Community) - EurOpen

ISE + .Net

F5 – Run script

Page 49: LibreOffice Presentation Template (Community) - EurOpen

Run Selection

F8 – Run selection

Page 50: LibreOffice Presentation Template (Community) - EurOpen

Debugging

F9 – Toggle break point

Page 51: LibreOffice Presentation Template (Community) - EurOpen

Direct printer simulator

Page 52: LibreOffice Presentation Template (Community) - EurOpen

PowerGUI

http://www.powergui.org

Page 53: LibreOffice Presentation Template (Community) - EurOpen

Examples @github

https://github.com/georgik/powershell-examples

Page 54: LibreOffice Presentation Template (Community) - EurOpen

Resources

PowerShell 3http://social.technet.microsoft.com/wiki/contents/articles/4725.powershell-v3-guide-en-us.aspx

PowerShell tipshttp://technet.microsoft.com/en-us/library/hh848797.aspx

Cheat Sheethttp://www.cheat-sheets.org/#WindowsPowerShell

PowerShell Bookshttp://powershellbooks.com/

Wikihttp://wiki.ysoft.local/display/RnD - How To PowerShell

Page 55: LibreOffice Presentation Template (Community) - EurOpen

Juraj Michálek2. 10. 2013