LogScrollTo value error

Dec 31, 2013 at 5:34 PM
Edited Jan 17, 2014 at 2:54 AM
In the "Collection - Add Computers.ps1" an error is generated when the "LogBox.text.Length" is less than 250. To work around this I put a simple if statement in there for each occurrence.

Here is the broken statement:
$LogScrollTo = $LogBox.Text.Length - 250
And here is my modification to correct the issue:
        If ($LogBox.Text.Length -gt 250) {
            $LogScrollTo = $LogBox.Text.Length - 250
        } else {
            $LogScrollTo = $LogBox.Text.Length
        }
Unless I'm missing something this should be all that is necessary to correct the errors and keep the Shell window behind the form free of unnecessary errors.