Search found 11276 matches

by jvierra
Fri Sep 15, 2017 1:37 pm
Forum: PowerShell GUIs
Topic: Multiform base on IP Range
Replies: 3
Views: 200

Re: Multiform base on IP Range

It is possible but would require that you have "location awareness" configured in AD.
by jvierra
Fri Sep 15, 2017 12:27 pm
Forum: PowerShell GUIs
Topic: Keeping Variables in external file
Replies: 13
Views: 384

Re: Keeping Variables in external file

The only thing I'm missing now is howto add comment into the textfile and PS Studio ignoring those lines during import. Maybe something like this: $GlobalVariables | ForEach-Object { if ($_.keys -notcontains '#'){ New-Variable -Name $_.keys -Value $_.values -Scope Global} } Gives an error but works...
by jvierra
Fri Sep 15, 2017 12:17 pm
Forum: PowerShell GUIs
Topic: Keeping Variables in external file
Replies: 13
Views: 384

Re: Keeping Variables in external file

Use Json or CliXml for complex objects. YOU can also use XML as a storage medium for complex data.
by jvierra
Fri Sep 15, 2017 12:10 pm
Forum: PowerShell GUIs
Topic: Cannot add-groupmember in PS Studio with variable
Replies: 17
Views: 366

Re: Cannot add-groupmember in PS Studio with variable

stevens wrote:
Fri Sep 15, 2017 5:57 am
Thanks, yes I know. Is that your answer to my question or should I deduct something out of that?
You cannot "return" anything from a child form.
by jvierra
Fri Sep 15, 2017 5:48 am
Forum: PowerShell GUIs
Topic: Cannot add-groupmember in PS Studio with variable
Replies: 17
Views: 366

Re: Cannot add-groupmember in PS Studio with variable

The return from calling a modal form is just the result of the closure.
by jvierra
Fri Sep 15, 2017 5:38 am
Forum: PowerShell GUIs
Topic: Cannot add-groupmember in PS Studio with variable
Replies: 17
Views: 366

Re: Cannot add-groupmember in PS Studio with variable

You cannot pass a variable from a modal form to the parent. Use a global.
by jvierra
Fri Sep 15, 2017 5:36 am
Forum: PowerShell GUIs
Topic: DataGridView sometime Colored sometime not
Replies: 5
Views: 84

Re: DataGridView sometime Colored sometime not

Move this line to AFTER the declaration of the event script block:

$dataGridView.add_CellFormatting($dataGridView_CellFormatting)
by jvierra
Fri Sep 15, 2017 5:35 am
Forum: PowerShell GUIs
Topic: DataGridView sometime Colored sometime not
Replies: 5
Views: 84

Re: DataGridView sometime Colored sometime not

Your event is not attached to the grid in the code you posted.

Copy all files to new folder and close all copies of PS. Run tests from fresh copy of PS and ISE. Both have no color.
by jvierra
Thu Sep 14, 2017 9:51 am
Forum: PowerShell GUIs
Topic: Keeping Variables in external file
Replies: 13
Views: 384

Re: Keeping Variables in external file

$data.Keys | %{Set-Variable -Name $_ -Value $data[$_] -Scope Global}

You must take time out to learn how to use PowerShell help:

help Set-Variable -online