Werbung

Herkunft

Kurzinformation

Copies dependency properties from one object to another.

Syntax

<# .Synopsis Copies dependency properties from one object to another. .Description Reads the dependency properties from one object and writes them to another. If a particular property could not be set, then the error encountered while trying to set the propery will be in the debug stream. #> param( [Parameter(ValueFromPipeline=$true)] [Windows.DependencyObject]$from, [Parameter(Position=0)] [Windows.DependencyObject[]]$to, [Parameter(Position=1)] [string[]] $property = "*" ) process { if (-not $from) { return } $from.GetLocalValueEnumerator() | Where-Object { foreach ($p in $property) { if ($_.Property.Name -like $p) { return $true } } } | ForEach-Object { foreach ($t in $to) { if (-not $t) { continue } try { $t.SetValue($_.Property, $_.Value) } catch { if ($debugPreference -eq "continue") { Write-Debug ($_ | Out-String) } } } } }

Beschreibung

Reads the dependency properties from one object and writes them to another. If a particular property could not be set,then the error encountered while trying to set the propery willbe in the debug stream.

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