windows powershell 5 preview april 2015 - dsinternals grafnetter windows powershell 5 preview april...

50
Michael Grafnetter www.dsinternals.com Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Upload: hatuong

Post on 27-Apr-2018

225 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Michael Grafnetter

www.dsinternals.com

Windows PowerShell 5

Preview April 2015

Gold partner: Generální partner:

Page 2: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Agenda

About PowerShell 4

PowerShell ISE 4

New Syntax

Desired State Configuration

New Cmdlets

Page 3: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Where to get it

Built-in

– Windows 10 Preview

Windows Management Framework 5.0 Preview April 2015

– Windows Server 2012 R2

– Windows 8.1 Pro

– Windows 8.1 Enterprise

– Windows Server 2012

– Windows 7 SP1

– Windows Server 2008 R2 SP1

Page 4: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Installing PowerShell 5

Page 5: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Checking PowerShell Version

Page 6: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Known incompatibilities

System Center 2012 Configuration Manager (without SP1)

Windows Small Business Server 2011 Standard

Page 7: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Missing Documentation

Page 8: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

BLACK is BACK!

Page 9: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Windows 10 Command Line

Page 10: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

ISE Remote Debugging

Page 11: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Advanced Debugging

Attach to process

– Enter-PSHostProcess

– Exit-PSHostProcess

Break All

– Console: Ctrl+Break

– ISE: Ctrl+B or Debug->Break All

Page 12: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Cortana and ISE

Page 13: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Context Menu

Page 14: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

PowerShell Transcription

Page 15: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

PowerShell Transcription

Page 16: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

PowerShell Script Block Logging

Page 17: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

PowerShell Script Block Logging

Page 18: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Symlink and Hardlink Support

New-Item -ItemType SymbolicLink -Name MySymLinkDir

-Target $pshome

New-Item -ItemType HardLink -Path C:\Temp

-Name MyHardLinkFile.txt -Value $pshome\profile.ps1

New-Item -ItemType Junction

-Path C:\Temp\MyJunctionDir -Value $pshome

Get-ChildItem

Page 19: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

DEMO

Page 20: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Managing .ZIP Files

Compress-Archive

[-Path] <String[]>

[-DestinationPath] <String>

[-CompressionLevel

<Microsoft.PowerShell.Commands.CompressionLevel>]

[-Update]

Expand-Archive

[-Path] <String>

[-DestinationPath] <String>

Page 21: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

DEMO

Page 22: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

New-TemporaryFile

Page 23: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Recursion Depth

Page 24: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Clipboard Manipulation

Page 25: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

DEMO

Page 26: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

New-Guid

Page 27: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Convert-String

Page 28: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

DEMO

Page 29: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

ConvertFrom-String

Page 30: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

DEMO

Page 31: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Microsoft Research FlashExtract

Page 32: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Warning

Convert-String

ConvertFrom-String

ConvertFrom-StringData

Page 33: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Format-Hex

Page 34: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Cryptographic Cmdlets (CMS - RFC5652)

Get-CmsMessage [-Path] <string>

Protect-CmsMessage [-To] <CmsMessageRecipient[]>

[-Content] <string> [[-OutFile] <string>]

Unprotect-CmsMessage [-Content] <string>

[[-To] <CmsMessageRecipient[]>] [-IncludeContext]

Page 35: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Cryptographic Cmdlets

Page 36: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

OData Utils

$uri =

"http://services.odata.org/V3/(S(readwrite))/OData/OData.svc/"

Export-ODataEndpointProxy -Uri $uri -OutputModule .\Service

Page 37: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

DEMO

Page 38: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Web Services in PowerShell SOAP / XML Web Services

– New-WebServiceProxy

OASIS OData– Export-ODataEndpointProxy

Generic REST– Invoke-RestMethod

Generic HTTP– Invoke-WebRequest

– ConvertFrom-Json

– ConvertTo-Json

– Select-Xml

Page 39: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

OneGet

Page 40: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Installing from GitHub

Page 41: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

DEMO

Page 42: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

PowerShellGet

Page 43: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

PowerShellGet Gallery

Page 44: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

SxS Module Version

Page 45: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Switch Management

Page 46: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Switch Management

Page 47: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Switch Management

Page 48: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Custom Enums and Classesenum Color

{

Green

Red

Blue

}

class Dog : Pet

{

Dog([string] $Name) : base($Name)

{

}

[string] Greet()

{

return 'Bark'

}

}

Page 49: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

DEMO

Page 50: Windows PowerShell 5 Preview April 2015 - DSInternals Grafnetter  Windows PowerShell 5 Preview April 2015 Gold partner: Generální partner:

Michael Grafnetter

www.dsinternals.com

Novinky PowerShell 5 Preview

Gold partner: Generální partner: