Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

PowerShell Logging.

$
0
0

Hi Guys, newbie here on the forums.

I looked for an answer to my question first, so this is more of a follow up to this post:
http://powershell.org/wp/forums/topic/save-the-output-of-powershell-script/

I use PowerShell quite a lot, but I am no means experienced with scripting/coding.

I have built, what I would class as crude PowerShell applications. A series of functions and a menu system built into a PS1 file.

What I have not been able to yet master is logging.

Just this morning I have found the ‘start-transcript’ command, which appears to be exactly what I want.

However, inside my application I suppress the errors so the user has a more elegant experience.

My thinking here is that a transcript, is essentially going to capture whatever is output to the console, and if i have
$ErrorAction = “SilentlyContinue” the errors wont be there to be transcripted.

What I would like to do is run a transcript but also capture the errors, whilst not displaying the errors out to the console.

Is that possible? Hopefully that makes sense?

Many thanks in advance if you are able to help out!


Viewing all articles
Browse latest Browse all 13067

Trending Articles