Author Posts

April 5, 2016 at 5:52 pm

is there a way to log a non-terminating error without forcing the script to stop with '-ErrorAction Stop'

April 5, 2016 at 6:04 pm

You can use the -ErrorVariable parameter, and check for any records in that variable after the command exits:

Do-Something -ErrorVariable myErrors

if ($myErrors)
{
    # handle errors
}