Skip to content

Commit

Permalink
Stop auto run of Get-Help
Browse files Browse the repository at this point in the history
Fixed spelling mistake
closes #1
  • Loading branch information
C493 committed Feb 5, 2024
1 parent ebf92ad commit 781b5ff
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions Write-ToLog.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -14,48 +14,48 @@ Function Write-ToLog {
Author : Patrick Cage ([email protected])
Version : 1.0.4 (2023-04-16)
License : GNU General Public License (GPL) v3
.PARAMETER Message
<string> [Required] The message to be written to the log file
.PARAMETER Severity
<string> [Optional] The severity of the message being written
Valid values: DEBUG, INFO, WARNING, ERROR
.PARAMETER Tag
<string> [Optional] The Tag to be added to the logged message
.PARAMETER LogFile
<System.IO.FileInfo> [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
#>
Expand Down Expand Up @@ -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 {
Expand All @@ -115,4 +115,4 @@ Function Write-ToLog {
Write-Verbose -Message "[$($MyInvocation.MyCommand.Name)] ${SeverityLevel}${Tag}${Message}"
}

Get-Help Write-ToLog -Full
#Get-Help Write-ToLog -Full

0 comments on commit 781b5ff

Please sign in to comment.