Werbung

Herkunft

Kurzinformation

Turns $legnth into Windows.GirdLength objects

Syntax

<# .Synopsis Turns $legnth into Windows.GirdLength objects .Description Turns the length parameter into GridLength objects. .Parameter length If the Length is just one integer, than that number of grid lengths will be created. If the Length is a list of strings and integers, then individual rows will be created If the string is 'Auto', the GridLength will be AutoSized If the string is a number followed by *, the GridLength will be a ratio of the available space If the string is a number, then the GridLength will be a specific number of pixels .Example ConvertTo-GridLength 5 .Example ConvertTo-GridLength 'Auto','1*', 'Auto' #> param( $length ) if ($length -as [uint32]) { foreach ($n in (1..$length)) { New-Object Windows.GridLength 1,Star } } else { foreach ($l in $length) { switch ($l) { Auto { New-Object Windows.GridLength 1, Auto } {$_ -as [Double]} { New-Object Windows.GridLength $_, Pixel } {"$_".EndsWith('*')} { $ratio = "$_".Split("*")[0] if (-not $ratio) { $ratio = 1 } New-Object Windows.GridLength $ratio, Star } } } }

Beschreibung

Turns the length parameter into GridLength objects.

Links

Liste aller Commandlets Mehr über die Windows PowerShell

Bücher zur PowerShell

Buchcover Windows PowerShell 5.0 - Das Praxishandbuch (1. Auflage 2016/5. Auflage Gesamtreihe) Windows PowerShell 5.0 - Das Praxishandbuch (1. Auflage 2016/5. Auflage Gesamtreihe)
Autoren: Dr. Holger Schwichtenberg
erschienen 2016, 996 Seiten, 49,99 €
ISBN: 3446446435
Bestellung: Amazon.de oder im Buchhandel über ISBN 3446446435

Schulungen/Seminare

Offene Seminare zur PowerShell
In-House-Seminare zur PowerShell