Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 2 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
This functions perfectly using powershell, but doesn't return anything through the GUI. I have traced through it, and it doesn't store $smallestDBSize which renders it useless.
I don't want to upgrade until I know this works, or why it doesn't. Please help...
Assuming Get-MailBoxDatabase isn't returning, not all commands work directly from a GUI. Try to call your function before the form is created. It is possible that you cannot do that from an event handler. Any code outside of any event will execute before the form is created.
Also, try running your form with STA Mode enabled.
If this doesn't help, please specify the module you are using and provide more of your script.
"it doesn't store $smallestDBSize". Can you elaborate on that? What does that mean?
Does this:
$smallestDBSize = $getDBStats.databasesize.tomb()
not return anything?
Or is this:
if ($tempDBSize -lt $smallestDBSize) {
$smallestDBsize = $tempDBSize
$arrayTarget = $count
}
not updating the variable?
Or is the variable $smallestDBSize empty after you return from this function?
This topic is 2 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.