Presentation is loading. Please wait.

Presentation is loading. Please wait.

Technology Specialist @ Methos IT Making your PowerShell scripts X times faster… with logical thinking and PowerShell v3 Jeff Wouters Technology Specialist.

Similar presentations


Presentation on theme: "Technology Specialist @ Methos IT Making your PowerShell scripts X times faster… with logical thinking and PowerShell v3 Jeff Wouters Technology Specialist."— Presentation transcript:

1 Technology Specialist @ Methos IT
Making your PowerShell scripts X times faster… with logical thinking and PowerShell v3 Jeff Wouters Technology Methos IT

2 Me, myself and I  http://www.jeffwouters.nl http://www.ngn.nl/hyperv

3 DuPSUG

4 Agenda First: Why PowerShell?
Understanding, avoiding and using the pipeline PoSH vs. ( WMI / CIM / .NET ) Ifs / Loops Workflows (Q & A) ?

5

6 Understanding the pipeline
Object 1 Object 2 Object 3 Object 4 Object 5 Object 6 Object 7 Object 8 Object 9 Object 10 Object 11 Object 12 Object 13 Object 1 Object 2 Object 3 Object 4 Object 5 Object 6 Object 1 Object 2 Understanding: Get-ChildItem –recurse | Where-Object { $_.Name -like "*Microsoft*" } Avoiding: Get-ChildItem -filter '*Microsoft*‘ -recurse Using: Get-ChildItem | Where-Object { $_.Name -like "*Microsoft*“ –and ($_.Length –ge "40") -and ($_.Length -le "60000")} Using: Get-ChildItem –Filter ‘*Microsoft*’ | Where-Object { ($_.Length –ge "40") -and ($_.Length -le "60000")}

7 Using the pipeline Filter Pipeline Query The right cmdlet

8 PowerShell vs. (...?...) CIM PowerShell .NET VBS

9 If / Loop If (statement) {ScriptBlock} Else {
Write-Output “Whatever…” } If ( statement ) { ScriptBlock } Elseif ( statement ) { ScriptBlock } Else { Write-Output “Whatever…” }

10

11 Switch Switch ( Object ) { { Comparison } { ScriptBlock; break }
Default { Write-Output “Whatever…” }

12 Workflow (v3!) You know, the cool stuff 

13 Workflow (v3!) Actions Time Configure node 1 2 Configure node 2
Mount / format quorum disk 4 Create cluster 1 Create cluster shared volume Join cluster node 2 Join cluster node 3 Cluster disk 2 (CSV) 10 Cluster disk 3 (CSV) Cluster disk 4 (CSV) TOTAL 44 Actions Time Configure nodes 2 Mount / format quorum disk 4 Create cluster 1 Create cluster shared volume Joing cluster nodes Mount cluster disks 10 Total 11

14 Questions?


Download ppt "Technology Specialist @ Methos IT Making your PowerShell scripts X times faster… with logical thinking and PowerShell v3 Jeff Wouters Technology Specialist."

Similar presentations


Ads by Google