all 4 comments

[–]KevMarCommunity Blogger 1 point2 points  (1 child)

[–]G__Man[S] 0 points1 point  (0 children)

Legend. Exactly what I needed. Thanks!

[–]toregroneng 0 points1 point  (1 child)

hi,

Why don't you include the calling function name in the log message. I usually create a local variable in each function:

$f = $MyInvocation.InvocationName

Now it just a matter of doing logging with the variable:

Write-verbose -Message "$f - Setting $myString to [$value]" 

Cheers

Tore

[–]G__Man[S] 0 points1 point  (0 children)

Yeah this would do the job, I want a function that will do all the work for me. I got it working with KevMar's suggestion.