Werbung

Herkunft

Kurzinformation

Creates a new System.Windows.Input.MouseBinding

Syntax

<# .Description Creates a new System.Windows.Input.MouseBinding .Synopsis Creates a new System.Windows.Input.MouseBinding .Example New-MouseBinding .Example New-MouseBinding -OutputXaml .Parameter OutputXaml If Set, will output the object as XAML instead of creating it #> param( ${Gesture}, [System.Windows.Input.MouseAction] ${MouseAction}, ${Command}, ${CommandParameter}, ${CommandTarget}, [Switch] ${OutputXaml}, [System.Collections.Hashtable] ${DependencyProperty} ) begin { } process { try { $Object = New-Object System.Windows.Input.MouseBinding } catch { throw $_ return } if ($PsBoundParameters.ContainsKey("DependencyProperty")) { $null = $PsBoundParameters.Remove("DependencyProperty") foreach ($dp in $dependencyProperty.GetEnumerator()) { if ($dp.Key -is [Windows.DependencyProperty]) { $Null = $Object.SetValue($dp.Key, $dp.Value) } else { $Prop = $Object.GetType()::"$($dp.Key)Property" if ($Prop) { $null = $Object.SetValue( $Prop, $dp.Value -as $Prop.PropertyType ) } } } } if ($command -is [string]) { $module =$myInvocation.MyCommand.Module.ModuleName $cmd = Get-Command "Get-*Command" -Module $module | Where-Object { $_.Parameters.$Command } if ($cmd) { $params = @{$Command = $true} $psBoundParameters.Command = & $cmd @Params } } Set-Property -property $psBoundParameters -inputObject $Object if ($outputXaml) { $strWrite = New-Object IO.StringWriter ([xml]([Windows.Markup.XamlWriter]::Save($Object))).Save($strWrite) return "$strWrite" } $Object } end { }

Beschreibung

Creates a new System.Windows.Input.MouseBinding

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