I've a question regarding Combobox and invoke-command.
Is it possible to populate the Combobox during invoke-command?
My wish is to get already some items inside the Box during invoke-command.
Issue is, that I've to connect to a database which is in another network, so I've to take a "Jumphost".
So, first I've to connect to the Jumpserver, then I can make the Database request.
But right now all the data of the Database populate the Combobox at the end of the invoke-command.
Right now it looks like this:
Code: Select all
$jumphost_request = invoke-command -computername $jumpserver -credential $cred_jumphost -Scriptblock {
.....
.....
....
New-Object -TypeName PSObject -Property @{
'productNames_users' = $productNames_users
'productNames_LC' = $productNames_LC
'productNames' = $productNames
'columnnames' = $columnnames
'ausgabe_TT' = $ausgabe_TT
'columheader_name' = $columheader_name
'user_selected' = $user_selected
'productNames3' = $productNames3
}
ForEach ($item in $jumphost_request)
{
$productNames_users = $item.productNames_users
$productNames_LC = $item.productNames_LC
$productNames = $item.productNames
$productNames3 = $item.productNames3
$columnnames = $item.columnnames
$ausgabe_TT = $item.ausgabe_TT
$columheader_name = $item.columheader_name
$user_selected = $item.user_selected
}
$combobox_Tabellenname_DB_TT.Items.AddRange($productNames)
....
But this way has a lot of disadvantages. It would be much better, that some data are already inside the Combobox before the Request really ends.
Thanks for any idea.