From 781b5ffb070fa8e5c35001a133d4f0cc3e725067 Mon Sep 17 00:00:00 2001 From: Patrick Cage Date: Mon, 5 Feb 2024 07:25:57 +0000 Subject: [PATCH] Stop auto run of Get-Help Fixed spelling mistake closes #1 --- Write-ToLog.ps1 | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Write-ToLog.ps1 b/Write-ToLog.ps1 index 950c2ff..04e8e92 100644 --- a/Write-ToLog.ps1 +++ b/Write-ToLog.ps1 @@ -2,9 +2,9 @@ Function Write-ToLog { <# .SYNOPSIS A PowerShell function for writing specified messages to a log file. - + .DESCRIPTION - Add this function to your script for easy, consitent writes to a log file. + Add this function to your script for easy, consistent writes to a log file. Writes a specified message to a log file, creating the log file if it does not already exist. Log entries are date and time stamped using ISO 8601 date format (e.g. 2022-09-02 19:22:00) Logging is enabled by default unless $script:LoggingEnabled variable is present and set to zero. @@ -14,48 +14,48 @@ Function Write-ToLog { Author : Patrick Cage (patrick@patrickcage.com) Version : 1.0.4 (2023-04-16) License : GNU General Public License (GPL) v3 - + .PARAMETER Message [Required] The message to be written to the log file - + .PARAMETER Severity [Optional] The severity of the message being written Valid values: DEBUG, INFO, WARNING, ERROR - + .PARAMETER Tag [Optional] The Tag to be added to the logged message - + .PARAMETER LogFile [Optional] The full path of the log file to be written to If not specified when calling the function or in the calling script, a file will be created within a LOGS folder inside the scripts parent folder. If the scripts parent folder path can't be obtained, it will fall back to C:\LOGS - + .EXAMPLE Write-ToLog "This message will be written to the log file" 2022-09-02 19:22:00 : This message will be written to the log file - + .EXAMPLE Write-ToLog "This message will be written to the log file" -LogFile "C:\Path\To\LogFile.txt" 2022-09-02 19:22:00 : This message will be written to the log file - + .EXAMPLE Write-ToLog -Message "This message will be written to the log file" -Severity INFO -Tag "TagValue" 2022-09-02 19:22:00 : INFO: [TagValue] This message will be written to the log file - + .EXAMPLE Write-ToLog -Message "This message will be written to the log file" -Tag "TagValue" 2022-09-02 19:22:00 : [TagValue] This message will be written to the log file - + .LINK https://www.patrickcage.com/write-tolog - + .LINK https://github.com/C493/write-tolog #> @@ -92,7 +92,7 @@ Function Write-ToLog { } else { $LogFile = $script:LogFile } } - + # Create the LogFile path if it doesn't exist If (!(Test-Path $LogFile -PathType Leaf)) { Try { @@ -115,4 +115,4 @@ Function Write-ToLog { Write-Verbose -Message "[$($MyInvocation.MyCommand.Name)] ${SeverityLevel}${Tag}${Message}" } -Get-Help Write-ToLog -Full \ No newline at end of file +#Get-Help Write-ToLog -Full \ No newline at end of file