Search found 12093 matches

by jvierra
Tue Apr 10, 2018 10:13 am
Forum: PowerShell GUIs
Topic: how to show main form if the form_load is not complted
Replies: 5
Views: 308

Re: how to show main form if the form_load is not complted

The following command is on multiple lines and will have an extra line break added to the file. add-Content -Path "c:\softdist\appinstaller2\$outputfile-$Date.log" -Value "Continuing Installs via Run Key of CFG File --> $P1CfgFile " -Force To avoid this we can: $msg = "Continuing Installs via Run Ke...
by jvierra
Tue Apr 10, 2018 10:07 am
Forum: PowerShell GUIs
Topic: how to show main form if the form_load is not complted
Replies: 5
Views: 308

Re: how to show main form if the form_load is not complted

In PowerShell with PS Studio all forms are displayed using ShowDialog. This is coded for you automatically. If the main form starts a child form the main form cannot be made current until the child is closed. I cannot understand what you are trying to do or what your issue is. If the system reboots ...
by jvierra
Tue Apr 10, 2018 9:41 am
Forum: PowerShell GUIs
Topic: how to show main form if the form_load is not complted
Replies: 5
Views: 308

Re: how to show main form if the form_load is not complted

$form.Show() cannot be used in PowerShell. You can only use "ShowDialog()" What you are trying to do cannot be done. You cannot split a command over many lines like you are doing. If you are trying to restart a form after a reboot then it is more sensible to set a flag in the registry and check it e...
by jvierra
Mon Apr 09, 2018 7:31 am
Forum: Windows PowerShell
Topic: Tail and parse log file
Replies: 1
Views: 239

Re: Tail and parse log file

You are not tailing at all. Here is how to tail a file:

Code: Select all

Get-Content C:\TestLogging.log -wait -Tail 1 |
    Select-String -Pattern 'Added sample 08|Added sample 11|Added sample 10|Added sample 20' | 
    Out-File .\Outlogfile.log
by jvierra
Mon Apr 09, 2018 7:06 am
Forum: PowerShell GUIs
Topic: Datagridview | Select DataBoundItem
Replies: 4
Views: 295

Re: Datagridview | Select DataBoundItem

To filter just set the RowFilter property. It takes one line.

$datagidview1.DatSource.DefaultView.RowFilter = ' your filter clause'

That is all we need to do to set the filter.
by jvierra
Mon Apr 09, 2018 2:27 am
Forum: PowerShell GUIs
Topic: Datagridview | Select DataBoundItem
Replies: 4
Views: 295

Re: Datagridview | Select DataBoundItem

You cannot manipulate a DataGridView that way. You can export the grid, filter the grid or sort the grid. You cannot reconvert the grid data to a new table. A loaded data table is automatically sortable by clicking the column header. To filter just set the RowFilter property of the DefaultView. Once...
by jvierra
Sun Apr 08, 2018 12:13 pm
Forum: PowerShell GUIs
Topic: Another refresh question
Replies: 16
Views: 557

Re: Another refresh question

Here is a working example. You will have to debug your other code since there is no way for me to do that.
by jvierra
Sun Apr 08, 2018 11:37 am
Forum: PowerShell GUIs
Topic: Another refresh question
Replies: 16
Views: 557

Re: Another refresh question

You define your parameters in one order but have passed them in a different order. If we use named parameters then we should name all parameters and pass by name. Mixing these will only lead to failure. If you pass by ref use the objects "Value". If you pass directly then don't use a ref. You are mi...
by jvierra
Sun Apr 08, 2018 11:27 am
Forum: PowerShell GUIs
Topic: Another refresh question
Replies: 16
Views: 557

Re: Another refresh question

You are not passing the parameters as they are defined.
by jvierra
Sun Apr 08, 2018 10:46 am
Forum: PowerShell GUIs
Topic: Another refresh question
Replies: 16
Views: 557

Re: Another refresh question

In you case the child form can access the variables of the calling function. This will wok in the child: $buttonEnable_Click={ $buttonOpenPopup.ImageIndex = 1 $formChildForm.Close() } Since the child function I s called in the scope of the parent form then all objects that are defined can be changed...