Search found 14929 matches

by jvierra
Fri Sep 24, 2021 2:49 pm
Forum: PowerShell
Topic: Using Microsoft Online Modules that require authentication popup
Replies: 2
Views: 322

Re: Using Microsoft Online Modules that require authentication popup

Simple answer. You can't. Depending on the version of the Cmdlets you can try setting MTA which works with some Cmdlets but the best method is to post in the "Teams" developer web forum for methods used to persist credentials outside of the process. You can also connect before the form is created th...
by jvierra
Wed Sep 22, 2021 3:44 pm
Forum: PowerShell
Topic: Need to pass only NOT NULL Hash Table values
Replies: 1
Views: 270

Re: Need to pass only NOT NULL Hash Table values

First a "Param" statement is alread a hash table so you don't need to reate a seco\d one. You can either set defaults on the params or you will have to test them. YOu can use validation statements to cause an exception to be thrown thus ending the command with a message. First take time to study how...
by jvierra
Mon Sep 20, 2021 8:13 am
Forum: PowerShell
Topic: Outlook COM Mark email as read
Replies: 19
Views: 6761

Re: Outlook COM Mark email as read

Here is something that you might find helpful:

https://github.com/PoshCode/PowerShellPracticeAndStyle
by jvierra
Sun Sep 19, 2021 6:25 pm
Forum: PowerShell GUIs
Topic: SAPIENTypes.SAPIENColorTable Runtime Issue
Replies: 1
Views: 524

Re: SAPIENTypes.SAPIENColorTable Runtime Issue

If it is not installed on the PC then you will not be able to load it.
by jvierra
Sat Sep 18, 2021 1:29 pm
Forum: PowerShell
Topic: Outlook COM Mark email as read
Replies: 19
Views: 6761

Re: Outlook COM Mark email as read

As there are many approaches to doing this as long as you don't try to enumerate teh collection in a loop. Using the index of the collection in reverse will avoid the issue. I would use more direct methods that don't create new refernces to teh COM objects. Every time you store a reference then it i...
by jvierra
Sat Sep 18, 2021 12:32 am
Forum: PowerShell
Topic: Outlook COM Mark email as read
Replies: 19
Views: 6761

Re: Outlook COM Mark email as read

Yes, you can reverse enumerate any stable collection. "Folder" items are stable collections and remain stable under reveres enumeration and change.
by jvierra
Fri Sep 17, 2021 7:35 pm
Forum: PowerShell
Topic: Outlook COM Mark email as read
Replies: 19
Views: 6761

Re: Outlook COM Mark email as read

"Delete" and "unread" change the members of the collection. As I noted this will cause members to be skipped as the collection pointer (index) is changing. Since the beginning of COM we have always retrieved the index of the collection then just loop through the indexes and change teh object. The in...
by jvierra
Fri Sep 17, 2021 2:32 pm
Forum: PowerShell
Topic: Outlook COM Mark email as read
Replies: 19
Views: 6761

Re: Outlook COM Mark email as read

Nothing wrong, that is how COM objects work always. Note that a COM you create is just a proxy for another actives process. If you interact and change things the proxied process will do dynamic adjustments to teh changes. This is true for all COM activations. Most people who are not trained in compu...
by jvierra
Wed Sep 15, 2021 8:13 am
Forum: PowerShell
Topic: ComboBox input to DataGridView
Replies: 5
Views: 1378

Re: ComboBox input to DataGridView

Also note that global does not define any control. It is just a blank file that you can use to create global variables. Controls on a form do not need to be defined as "global" and the code you are writing should not declare simple variables as "global". With Sapien PSS the control variables are def...
by jvierra
Wed Sep 15, 2021 8:04 am
Forum: PowerShell
Topic: ComboBox input to DataGridView
Replies: 5
Views: 1378

Re: ComboBox input to DataGridView

Again, the code posted is dependent on the whole of the DGV configuration. WIthout all of the settings then there is no way to know what is happening. Start simple. Create a simple form with a DGV and change no settings. Add one button and add the code you just posted. When working just remove all p...