Search found 11054 matches

by jvierra
Fri Jul 14, 2017 3:33 pm
Forum: Windows PowerShell
Topic: Out-gridview to a single variable.
Replies: 2
Views: 125

Re: Out-gridview to a single variable.

Like this:

Code: Select all

Import-Csv d:\files\divcode.csv |
out-gridview -OutputMode Single -Title 'Select a row' |
Select-Object -expand DivisionCode
by jvierra
Fri Jul 14, 2017 3:29 pm
Forum: PowerShell GUIs
Topic: How to use the textbox to gather input for a variable?
Replies: 10
Views: 126

Re: How to use the textbox to gather input for a variable?

Just to be clear, I have tried reading the post and article on Sapien and even Spiceworks. Nothing tells me how a textbox value is stored into a variable and then pasted into an argument or function. The variables that I use keep having empty/null values. In forms the controls are the variables. We...
by jvierra
Fri Jul 14, 2017 3:18 pm
Forum: PowerShell GUIs
Topic: How to use the textbox to gather input for a variable?
Replies: 10
Views: 126

Re: How to use the textbox to gather input for a variable?

This is where well formatted code can help you spot errors: Here is what you are using but formatted so it is readable: $OKButton.Add_Click({ $script:xServerName = $objServer_TextBox1.Text $xService = $objTextBox2.Text $objForm.Close() }) I think you can now see what is wrong. You just forgot to dec...
by jvierra
Fri Jul 14, 2017 2:50 pm
Forum: PowerShell GUIs
Topic: DataGridView
Replies: 14
Views: 120

Re: DataGridView

Now that I have toggled that setting on an d off it is correctly creating forms with 2.0 assemblies when set and 4.0 when not set. Originally it was set and a bew form would still use 4.0 until I changed the platform to PS v2 and back. Strange?!? The 141 update trashed PSS and forced me to uninstall...
by jvierra
Fri Jul 14, 2017 10:27 am
Forum: PowerShell GUIs
Topic: DataGridView
Replies: 14
Views: 120

Re: DataGridView

To allow the assemblies to follow the platform selections just clear the designer option for " Enable PowerShell V2 assembly compatibility ". This will prevent the degradation to V2 assemblies when selecting newer platforms. It does appear that the workflow for the build has a bug in that it chooses...
by jvierra
Fri Jul 14, 2017 10:18 am
Forum: PowerShell GUIs
Topic: DataGridView
Replies: 14
Views: 120

Re: DataGridView

Yup! Once we build for V2 the assemblies are never updated if switching to a newer PS version.

There must be a way to force the assemblies to update to the requested version.
by jvierra
Fri Jul 14, 2017 10:14 am
Forum: PowerShell GUIs
Topic: DataGridView
Replies: 14
Views: 120

Re: DataGridView

If you select compatibility to V2 then it will use V2 assemblies and they need to be specified in the options. I just found an anomaly in PSS 141. If I create and run a simple form with V5/64 and look at the code it loads the Net 4.0 assemblies. If I then set the PSF to run V2/64 it loads the Net 2....
by jvierra
Fri Jul 14, 2017 9:42 am
Forum: PowerShell GUIs
Topic: DataGridView
Replies: 14
Views: 120

Re: DataGridView

Without the DGV you can easily check the running Net version by adding this to the form load. It will appear in the output pane when the form opens.

Write-Host ([System.Windows.Forms.DataGridView].Assembly.ImageRuntimeVersion)
by jvierra
Fri Jul 14, 2017 9:35 am
Forum: PowerShell GUIs
Topic: DataGridView
Replies: 14
Views: 120

Re: DataGridView

Sometimes a PSF file can become corrupted and odd things will happen. Have you tried starting a new form and adding just the DGV to the form then run it. If this fails then the issue is not likely with the PSF file. If it succeeds then suspect the PSF. You clearly have V2 support installed as you ca...
by jvierra
Fri Jul 14, 2017 8:20 am
Forum: PowerShell GUIs
Topic: DataGridView
Replies: 14
Views: 120

Re: DataGridView

What version of PSS are you running?