Werbung

Herkunft

Kurzinformation

Exports a View Definition for a particular type

Syntax

<# .Synopsis Exports a View Definition for a particular type .Description Creates a ViewDefinition element to show only a few properties of any type .Example [Windows.Controls.ContentControl] | Export-FormatPs1Xml .Parameter Type The type to create a view definition for .Parameter Property One or more properties to display for the type .Parameter Label Alternative labels to display for each column .Parameter Width Specific widths of each column #> param( [Parameter(ValueFromPipeline=$true,Mandatory=$true)] [Type]$Type, [Parameter(Mandatory=$true, HelpMessage="Enter the name of one or more properties to show for the type.")] [string[]]$Property, [string[]]$Label = @(), [int[]]$Width = @() ) process { $headers = "" $columnItems = "" for ($i = 0; $i -lt $property.Count; $i++) { if ($width[$i] -or $label[$i]) { $headers += " " if ($width[$i]) { $headers += " $($width[$i]) " } if ($label[$i]) { $headers += " " } $headers += " " } else { $headers += " " } $columnItems += " $($property[$i]) " } @" $($type.Fullname) $($type.FullName) $($headers.Trim()) $($columnItems.Trim()) "@ }

Beschreibung

Creates a ViewDefinition element to show only a few properties of any type

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