Powershell Log your Scripts

log your scripts to checkout your script behavior ,we can do that by simple function includes TimeStamp and your Note

you wanna add at any stage on your script .

where’s the log file located ?

lets make it as function –

the TimeStamp format contains with Date | hour :





now lets combine it our script :


each time we’ll use the keyword function ‘log’ it will write our comment to the $logfile and will also write it to the Console.


(Visited 8,421 times, 1 visits today)

Leave a Reply