Changing values in Text box

Dec 22, 2013 at 1:53 PM
Hi
While Show-UI -asjob is running, can be change value in a Text box from command line?

Kind regards
Coordinator
Dec 23, 2013 at 5:06 AM
Yep, just use Update-WPFJob to set it. The simplest thing is to use Get-ChildControl to find the thing you're trying to change.
$job = Textbox -Name Greeting "Hello World" -asjob
Update-WPFJob -Job $job { (Get-ChildControl "Greeting").Text = "Hello ${Env:UserName}" }
Dec 23, 2013 at 6:45 AM
Thanks Jaykul, but I'm getting following error:

Cannot find an overload for "InvokeScriptInJob" and the argument count: "2".
At C:\Users\farrukhw\Documents\WindowsPowerShell\Modules\WPK\Update-WPFJob.ps1:40 char:21
  • $job.InvokeScriptInJob($Command, $null)
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [], MethodException
    • FullyQualifiedErrorId : MethodCountCouldNotFindBest
Coordinator
Dec 23, 2013 at 7:31 AM
WPK? You need to download a (much) newer module.
Dec 23, 2013 at 4:09 PM
Jaykul wrote:
WPK? You need to download a (much) newer module.
This is recently downloaded and imported... :(
Coordinator
Dec 24, 2013 at 7:46 PM
There's no recent release of WPK... WPK is what merged with PowerBoots to become ShowUI...

If you: Get-Module ShowUI | Format-Table Name, Version, Path -auto

You should be using 1.4 or at least 1.3 ...