Search found 11 matches

by Rixtter747
Tue May 25, 2021 12:51 am
Forum: PowerShell
Topic: bug:: function not returning value
Replies: 3
Views: 7318

bug:: function not returning value

Hi folks, I'm on version 2019, would like to upgrade but the one thing i use this for doesn't work correctly. Here is the code: function SelectSmallestDatabase { $count = 0 $arrayTarget = 0 $getDBs = get-MailboxDatabase "DAG2*" $countDBs = $getDBs.Count $getDBStats = get-MailboxDatabase $g...
by Rixtter747
Thu Dec 12, 2019 2:48 am
Forum: PowerShell Studio
Topic: Deleting my posts?
Replies: 2
Views: 2454

Re: Deleting my posts?

Thanks Brittney, and I apologise completely for being a numpty! I haven't been receiving emails as expected, but being the email administrator I think I'll go check why our IronPort devices are quarantining them without notifying me :lol: I have had excellent answers to my original questions, I coul...
by Rixtter747
Thu Dec 12, 2019 2:46 am
Forum: PowerShell
Topic: try... catch... not firing
Replies: 9
Views: 10037

Re: try... catch... not firing

Remember that a try/catch will only work on terminating errors. As jvierra mentioned, you can add the -erroraction to a cmdlet or you can set all errors to terminate by using the $erroractionpreference variable. Thanks daveyc, another interesting option although I'll keep it local just to be safe. ...
by Rixtter747
Thu Dec 12, 2019 2:43 am
Forum: PowerShell
Topic: try... catch... not firing
Replies: 9
Views: 10037

Re: try... catch... not firing

Hi rixtter. Your issue is an issue with how to use the exception handling in PowerShell and has noting to do wit PSS. I suggest starting with the help for try/catch: help about_try_catch To cause a trappable event to work in a try/catch it is necessary to add "-ErrorAction Stop" to each c...
by Rixtter747
Thu Dec 12, 2019 2:37 am
Forum: PowerShell
Topic: try... catch... not firing
Replies: 9
Views: 10037

Re: try... catch... not firing

Alright, let me first state that I understand your frustration. Every software developer hates little more than code working in one spot but not the other for no apparent reason. But, let me address this here as clearly as possible, since this keeps coming up. Windows Forms is part of the Microsoft...
by Rixtter747
Wed Dec 11, 2019 8:44 am
Forum: PowerShell Studio
Topic: Deleting my posts?
Replies: 2
Views: 2454

Deleting my posts?

That's twice I've had posts deleted.

If I express that I am unhappy, that is my choice. I am also registering legitimate problems with your software.

Why are you deleting my posts?
by Rixtter747
Wed Dec 11, 2019 7:51 am
Forum: PowerShell
Topic: try... catch... not firing
Replies: 9
Views: 10037

try... catch... not firing

Hi folks, I have several try... catch statements in my code, working well until this latest attempt. try { Get-Mailbox $searchCriteria $txtInfo.Text = Get-Mailbox $searchCriteria | select name, database $radMoveToSmallest.Enabled = $true $radMoveToSpecific.Enabled = $true } catch { $txtInfo.Text = &...
by Rixtter747
Thu Dec 05, 2019 8:18 am
Forum: PowerShell Studio
Topic: Variable scope?
Replies: 1
Views: 1992

Variable scope?

I figured placing a standard $myVariable in Globals.ps1 would keep it's scope throughout all forms but it doesn't. Is this expected?

I've went ahead with $global:myVariable but just thought I'd mention in case it was a bug. Still learning :D
by Rixtter747
Thu Dec 05, 2019 8:03 am
Forum: PowerShell Studio
Topic: Adding new form... misleading...
Replies: 2
Views: 2315

Re: Adding new form... misleading...

Thanks for the reply, I'm a happy coder again :D
by Rixtter747
Wed Dec 04, 2019 2:53 pm
Forum: PowerShell Studio
Topic: Adding new form... misleading...
Replies: 2
Views: 2315

Adding new form... misleading...

Hey all, So I've been trying my first multi-form project. When I load a standard multi-form, attempt adding a new form via the File...New...Form. I don't get what I would expect to. The manuals suggest loading the new form via an event call Show-MyNewForm_psf which is auto-generated from a newly sav...