Search found 15436 matches

by jvierra
Mon Aug 14, 2023 1:14 am
Forum: PowerShell Studio
Topic: $RegKey.close() kicks strange error in Debug but not in console
Replies: 11
Views: 2231

Re: $RegKey.close() kicks strange error in Debug but not in console

You cannot use both "Dispose" and "Close like that, just use "Close". PS will do the disposal for you.
by jvierra
Mon Aug 14, 2023 12:56 am
Forum: PowerShell Studio
Topic: $RegKey.close() kicks strange error in Debug but not in console
Replies: 11
Views: 2231

Re: $RegKey.close() kicks strange error in Debug but not in console

For future reference: [Microsoft.Win32.RegistryValueKind]::ExpandString All type are enumerated in tghis version of Net. Type the lib class and two colons then each time you hit tab it will get the next type name. To get the numeric value just cast to "Int". [int][Microsoft.Win32.RegistryV...
by jvierra
Sun Aug 13, 2023 4:53 am
Forum: PowerShell GUIs
Topic: Multi Color Text in RichTextBox
Replies: 1
Views: 1518

Re: Multi Color Text in RichTextBox

Use "SelectedText but first you have to select the text you want to be color.

$rtb.Select(start, length)

See DOCs for detailed examples.
by jvierra
Thu Aug 03, 2023 5:18 pm
Forum: PowerShell GUIs
Topic: get-vm
Replies: 2
Views: 1588

Re: get-vm

Here is an easy way to get data into a GridView:

help Out-GridView -full
by jvierra
Thu Jul 27, 2023 6:55 pm
Forum: PowerShell GUIs
Topic: Open Form into panel via public function
Replies: 1
Views: 1768

Re: Open Form into panel via public function

You are cannot open a form in a control in WinForms.

You seem to be always closing some child form for some unknow reaon. No saying what this may cause to happen.

I know of no C# Forms code that can open a form in a tab control. Perhaps you are seeing WPF which has some ability to do this.
by jvierra
Tue Jul 18, 2023 6:53 pm
Forum: PowerShell
Topic: Getting different .gettype() on two different Machines
Replies: 7
Views: 4370

Re: Getting different .gettype() on two different Machines

The pipeline was designed t handle all returns. It can return null, a singularity or a collection. Collections are enumerated into the pipeline. This is the recommended method. Another technique is to "cast" the return to an array. [ $mgmtsObjects = [array](Get-WmiObject ....) Now your res...
by jvierra
Wed Jul 05, 2023 1:46 am
Forum: PowerShell
Topic: Unable to run Exchange online cmdlets in Powershell Studio 2023
Replies: 2
Views: 2008

Re: Unable to run Exchange online cmdlets in Powershell Studio 2023

You would be better off asking exchange PowerShell version related questions in the Microsoft forum for exchange PowerShell.

“exo” has commands and methods for managing distribution groups.

https://practical365.com/getting-exchan ... owershell/
by jvierra
Fri Jun 30, 2023 5:23 pm
Forum: PowerShell
Topic: Unable to create Reg Key
Replies: 14
Views: 4565

Re: Unable to create Reg Key

The following makes a bad assumption. $user = get-wmiobject -Class Win32_Computersystem | select Username; $sid = (New-Object System.Security.Principal.NTAccount($user.UserName)).Translate([System.Security.Principal.SecurityIdentifier]).value; ]/b] It assumes a single user logged in at the console. ...
by jvierra
Fri Jun 30, 2023 10:49 am
Forum: PowerShell
Topic: Unable to create Reg Key
Replies: 14
Views: 4565

Re: Unable to create Reg Key

jvierra, You comments are some what insulting. You don't know me and you don't know what I am capable of. I apologize if you have taken my comments as insulting, I was only trying to get you to realize that there are areas of Windows development that have specific requirements and reviewing that wo...