Werbung

Herkunft

Kurzinformation

Updates a running WPF Job by running a PowerShell script

Syntax

<# .Synopsis Updates a running WPF Job by running a PowerShell script .Description Runs a PowerShell script within a WPF Job and returns the results. This enables two way communication with WPF Jobs. You can use the $Window variable and Get-ChildControl to talk to individual controls within a UI. .Example $Job = New-Label "Hello World" -AsJob $job | Update-WPFJob { $window.Close() } #> [CmdletBinding(DefaultParameterSetName='NoParameters')] param( # The Job to update [Parameter(Mandatory=$true, ValueFromPipeline=$true)] [Management.Automation.Job] $Job, [Parameter(Position=0)] [ScriptBlock] $Command, [Parameter(ParameterSetName='IDictionary', Position=1)] [Collections.IDictionary] $Dictionary, [Parameter(ParameterSetName='IList', Position=1)] [Collections.IList] $List ) process { if ($job.InvokeScriptInJob) { switch ($psCmdlet.ParameterSetName) { NoParameters { $job.InvokeScriptInJob($Command, $null) } List { $job.InvokeScriptInJob($command, $List) } Dictionary { $job.InvokeScriptInJob($Command, $Dictionary) } } } }

Beschreibung

Runs a PowerShell script within a WPF Job and returns the results.This enables two way communication with WPF Jobs.You can use the $Window variable and Get-ChildControl to talk to individual controls within a UI.

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