I am trying to create my own logging via powershell script, so far the function writes the log as expected, however when I call the function to return the result of an actio