Module Name | Module Guid | Module Version | Locale |
---|---|---|---|
TUN.Logging |
eeac1534-25a5-4429-a073-17ec769525f5 |
1.2.0 |
en-US |
Provides easy to use file and mail logging. Documentation of module at https://github.com/echalone/TUN/blob/master/PowerShell/Modules/TUN.Logging/TUN.Logging.md
- TUN.Credentials (1.1.0)
- Description
- Required Modules
- Content
- TUN.Logging Cmdlets
- Get-HasLogDebug
- Get-HasLogError
- Get-HasLogHost
- Get-HasLogInformation
- Get-HasLogOutput
- Get-HasLogVerbose
- Get-HasLogWarning
- Get-HasMailLogDebug
- Get-HasMailLogError
- Get-HasMailLogHost
- Get-HasMailLogInformation
- Get-HasMailLogOutput
- Get-HasMailLogVerbose
- Get-HasMailLogWarning
- Get-TUNLoggingVersion
- Send-Log
- Set-ForceLogSend
- Set-LogFallbackConsoleColors
- Set-MailLogCredentials
- Set-TUNLogging_LocalMode
- Start-Log
- SYNOPSIS
- SYNTAX
- DESCRIPTION
- PARAMETERS
- -LogPath
- -LogName
- -LogExtension
- -ConfigurationName
- -LogPreference_LogError
- -LogPreference_LogHost
- -LogPreference_LogOutput
- -LogPreference_LogVerbose
- -LogPreference_LogWarning
- -LogPreference_LogDebug
- -LogPreference_LogInformation
- -NoFileLog
- -NoTextLog
- -NoTimestamp
- -UseComputerPrefix
- -UseScriptPrefix
- -UseDefaultName
- -NoDateTimeFormat
- -DeleteExisting
- -AsOutput
- -Force
- -WhatIf
- -Confirm
- CommonParameters
- OUTPUTS
- Start-MailLog
- SYNOPSIS
- SYNTAX
- DESCRIPTION
- PARAMETERS
- -ConfigurationName
- -CredentialsFile
- -LogPreference_MailError
- -LogPreference_MailHost
- -LogPreference_MailOutput
- -LogPreference_MailVerbose
- -LogPreference_MailWarning
- -LogPreference_MailDebug
- -LogPreference_MailInformation
- -AddTimestamp
- -AsOutput
- -InitCredentials
- -Force
- -WhatIf
- -Confirm
- CommonParameters
- OUTPUTS
- NOTES
- Stop-Log
- Write-DebugLog
- Write-ErrorLog
- Write-HostLog
- Write-InformationLog
- Write-OutputLog
- Write-VerboseLog
- Write-WarningLog
Determines if debug messages were logged to the log file (so far).
Get-HasLogDebug [[-ConfigurationName] <String[]>] [<CommonParameters>]
One or more names of the configurations for which to get the information for. Default is $null the information will be retrieved for all running configurations.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
True....There have been debug messages logged to the log file
False...No debug messages have yet been logged to the log file
Determines if errors were logged to the log file (so far).
Get-HasLogError [[-ConfigurationName] <String[]>] [<CommonParameters>]
One or more names of the configurations for which to get the information for. Default is $null the information will be retrieved for all running configurations.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
True....There have been errors logged to the log file
False...No errors have yet been logged to the log file
Determines if host messages were logged to the log file (so far).
Get-HasLogHost [[-ConfigurationName] <String[]>] [<CommonParameters>]
One or more names of the configurations for which to get the information for. Default is $null the information will be retrieved for all running configurations.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
True....There have been host messages logged to the log file
False...No host messages have yet been logged to the log file
Determines if information messages were logged to the log file (so far).
Get-HasLogInformation [[-ConfigurationName] <String[]>] [<CommonParameters>]
One or more names of the configurations for which to get the information for. Default is $null the information will be retrieved for all running configurations.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
True....There have been information messages logged to the log file
False...No information messages have yet been logged to the log file
Determines if output messages were logged to the log file (so far).
Get-HasLogOutput [[-ConfigurationName] <String[]>] [<CommonParameters>]
One or more names of the configurations for which to get the information for. Default is $null the information will be retrieved for all running configurations.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
True....There have been output messages logged to the log file
False...No output messages have yet been logged to the log file
Determines if verbose messages were logged to the log file (so far).
Get-HasLogVerbose [[-ConfigurationName] <String[]>] [<CommonParameters>]
One or more names of the configurations for which to get the information for. Default is $null the information will be retrieved for all running configurations.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
True....There have been verbose messages logged to the log file
False...No verbose messages have yet been logged to the log file
Determines if warnings were logged to the log file (so far).
Get-HasLogWarning [[-ConfigurationName] <String[]>] [<CommonParameters>]
One or more names of the configurations for which to get the information for. Default is $null the information will be retrieved for all running configurations.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
True....There have been warnings logged to the log file
False...No warnings have yet been logged to the log file
Determines if debug messages were logged to the mail log (so far).
Get-HasMailLogDebug
True....There have been debug messages logged to the mail log
False...No debug messages have yet been logged to the mail log
Determines if errors were logged to the mail log (so far).
Get-HasMailLogError [[-ConfigurationName] <String[]>] [<CommonParameters>]
One or more names of the configurations for which to get the information for. Default is $null the information will be retrieved for all running text configurations.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
True....There have been errors logged to the mail log
False...No errors have yet been logged to the mail log
Determines if host messages were logged to the mail log (so far).
Get-HasMailLogHost
True....There have been host messages logged to the mail log
False...No host messages have yet been logged to the mail log
Determines if information messages were logged to the mail log (so far).
Get-HasMailLogInformation
True....There have been information messages logged to the mail log
False...No information messages have yet been logged to the mail log
Determines if output messages were logged to the mail log (so far).
Get-HasMailLogOutput
True....There have been output messages logged to the mail log
False...No output messages have yet been logged to the mail log
Determines if verbose messages were logged to the mail log (so far).
Get-HasMailLogVerbose
True....There have been verbose messages logged to the mail log
False...No verbose messages have yet been logged to the mail log
Determines if warnings were logged to the mail log (so far).
Get-HasMailLogWarning
True....There have been warnings logged to the mail log
False...No warnings have yet been logged to the mail log
Returns version of current TUN.Logging module
Get-TUNLoggingVersion [-AsString] [<CommonParameters>]
True/Present...will return a version string False/Absent...will return a version object
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Version of TUN.Logging module
Stops logging process for mail log and sends the mail log text as a text mail. Optionally attaches the file log as attachment.
Send-Log [-From] <String> [-To] <String[]> [[-SmtpServer] <String>] [[-Subject] <String>]
[[-ConfigurationName] <String>] [[-AttachLogFileConfigurations] <String[]>] [[-UserName] <String>]
[[-Password] <SecureString>] [-UseSsl] [-AlwaysSend] [-SendOnError] [-SendOnHost] [-SendOnOutput]
[-SendOnVerbose] [-SendOnWarning] [-SendOnDebug] [-SendOnInformation] [-AttachLogfile] [-KeepLogging]
[-WhatIf] [-Confirm] [<CommonParameters>]
The from email address.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The to email address. Can be one or more email addresses to which the email will be sent.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The SMTP server to use for sending the email. If this parameter is not provided, the default SMTP server as defined in $PSEmailServer will be used.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: $PSEmailServer
Accept pipeline input: False
Accept wildcard characters: False
The beginning of the subject line of the email.
Will interpret
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
One or more names of the configurations to send emails for. The default is $null and will... a) Check if a DefaultMailLog configuration exists and send that b) If no DefaultMailLog configuration exists, will send all running text logs as their own mail
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Will attach log files of the provided configurations, if their file logging is enabled.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The user to use for authentication at the smtp server. Default is $null and will either use Credentials-File or current user (depending on if credentials file was provided).
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The password to use for authentication at the smtp server.
Type: SecureString
Parameter Sets: (All)
Aliases:
Required: False
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will use Ssl to connect to the smtp server
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will always send the email, no matter what exactly was logged.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will send the email if an error occured and was logged in the mail text.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will send the email if an error occured and was logged in the mail text.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will send the email if an error occured and was logged in the mail text.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will send the email if an error occured and was logged in the mail text.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will send the email if an error occured and was logged in the mail text.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will send the email if an error occured and was logged in the mail text.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will send the email if an error occured and was logged in the mail text.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will attach the log file of the configuration to the log mail if file logging was enabled for that configuration.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not stop the logs for which an email was sent
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None
Once this function has been called, the Write-ErrorLog etc. functions will not add any more lines to the mail log.
Sets a flag to trigger the sending of the log mail as soon as Send-Log is called (no matter what messages have been logged).
Set-ForceLogSend [[-Reason] <String>] [[-ConfigurationName] <String[]>] [<CommonParameters>]
The reason for force sending of mail log (will be added to subject line). If no reason is given here, "forced" will be given as reason in the subject line.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
One or more names of the configurations for which to force log sending. Default is $null and all running text configurations will be forced to send.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None
Sets global fallback colors for console output (needed fox linux).
Set-LogFallbackConsoleColors [[-FallbackForegroundColor] <ConsoleColor>]
[[-FallbackBackgroundColor] <ConsoleColor>] [-WhatIf] [-Confirm] [<CommonParameters>]
Sets global fallback colors for console output (needed fox linux).
The fallback foreground color for the console if none was provided and the current foreground color could not be determined from the console. The default is Gray.
Type: ConsoleColor
Parameter Sets: (All)
Aliases:
Accepted values: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White
Required: False
Position: 1
Default value: Gray
Accept pipeline input: False
Accept wildcard characters: False
The fallback background color for the console if none was provided and the current background color could not be determined from the console. The default is Black.
Type: ConsoleColor
Parameter Sets: (All)
Aliases:
Accepted values: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White
Required: False
Position: 2
Default value: Black
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None
Sets the credentials for mail log sending.
Set-MailLogCredentials [[-ConfigurationName] <String>] [-CredentialsFile] <String> [-InitCredentials] [-WhatIf]
[-Confirm] [<CommonParameters>]
Sets the credentials for mail log sending.
Name of the configuration to initialize with these settings. The default will be DefaultMailLog.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: $script:__Constant_DefaultGlobalMailLogName__
Accept pipeline input: False
Accept wildcard characters: False
File to store mailing credentials in and read mailing credentials from (for access to the smtp server). Information will be stored in the XML file format. This parameter is mandatory.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True/Present...The script will ask for the credentials to use for mail sending, store them in the credentials file and will then immediatly exit the script. Used to either set up credentials file for the first time, or change/renew the credentials in the credential file, without performing the actual task by the script. The -WhatIf switch cannot be used to make sure the script is not performing its task, because it will also prevent the script from saving the credentials to the credentials file. This switch is ignored if the CredentialsFile parameter is not provided.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None
If the credentials file cannot be found, it will ask the user for the credentials and stores it in the credential file. For first use or to change the credentials, use the -InitCredentials switch, which will force storing new credentials and exits the script immediately after saving the credentials without executing the rest of the script. This is because the -WhatIf switch cannot be used to make sure the script is not performing its task, because it will also prevent the script from saving the credentials to the credentials file.
Sets local mode for TUN Logging (for backwards compatibility)
Set-TUNLogging_LocalMode [-Global] [<CommonParameters>]
True/Present...Will use new global mode (which is activated by default, only needed to reset to global mode) False/Absent...Will use local mode (call this function without switch to use local mode)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None
Starts logging process for file log.
Start-Log [[-LogPath] <String>] [[-LogName] <String>] [[-LogExtension] <String>]
[[-ConfigurationName] <String>] [[-LogPreference_LogError] <Boolean>] [[-LogPreference_LogHost] <Boolean>]
[[-LogPreference_LogOutput] <Boolean>] [[-LogPreference_LogVerbose] <Boolean>]
[[-LogPreference_LogWarning] <Boolean>] [[-LogPreference_LogDebug] <Boolean>]
[[-LogPreference_LogInformation] <Boolean>] [-NoFileLog] [-NoTextLog] [-NoTimestamp] [-UseComputerPrefix]
[-UseScriptPrefix] [-UseDefaultName] [-NoDateTimeFormat] [-DeleteExisting] [-AsOutput] [-Force] [-WhatIf]
[-Confirm] [<CommonParameters>]
Once this function has been called, the Write-ErrorLog etc. functions will add lines to a log file.
Path to the logfile directory.
The default value is "." for the current working directory.
Will interpret
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: .\
Accept pipeline input: False
Accept wildcard characters: False
Name of the logfile, will be interpreted as a datetime format if NoDateTimeFormat switch is not set.
Therefore, certain (or optionally all) letters will have to be escaped with a backslash if they should
not be interpreted as a datetime format character.
If this parameter is not provided, it will behave as if -UseDefaultName switch is set.
Will interpret
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Extension of the logfile The default value is "log" if not specified otherwise.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: Log
Accept pipeline input: False
Accept wildcard characters: False
Name of the configuration to initialize with these settings. The default will be DefaultFileLog.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: $script:__Constant_DefaultGlobalFileLogName__
Accept pipeline input: False
Accept wildcard characters: False
True....Will add error messages to the file log (no matter if they are displayed or logged in the mail log) False...Will not add error messages to the file log (no matter if they are displayed or logged in the mail log) null or not specified...The adding of error messages depends on the AsOutput switch. If the AsOutput switch is present, then error messages will only be added if they are displayed, if the AsOutput switch is absent, they will always be added.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True....Will add host messages to the file log (no matter if they are displayed or logged in the mail log) False...Will not add host messages to the file log (no matter if they are displayed or logged in the mail log) null or not specified...The adding of host messages depends on the AsOutput switch. If the AsOutput switch is present, then host messages will only be added if they are displayed, if the AsOutput switch is absent, they will always be added.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True....Will add output messages to the file log (no matter if they are displayed or logged in the mail log) False...Will not add output messages to the file log (no matter if they are displayed or logged in the mail log) null or not specified...The adding of output messages depends on the AsOutput switch. If the AsOutput switch is present, then output messages will only be added if they are displayed, if the AsOutput switch is absent, they will always be added.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True....Will add verbose messages to the file log (no matter if they are displayed or logged in the mail log) False...Will not add verbose messages to the file log (no matter if they are displayed or logged in the mail log) null or not specified...The adding of verbose messages depends on the AsOutput switch. If the AsOutput switch is present, then verbose messages will only be added if they are displayed, if the AsOutput switch is absent, they will always be added.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True....Will add warning messages to the file log (no matter if they are displayed or logged in the mail log) False...Will not add warning messages to the file log (no matter if they are displayed or logged in the mail log) null or not specified...The adding of warning messages depends on the AsOutput switch. If the AsOutput switch is present, then warning messages will only be added if they are displayed, if the AsOutput switch is absent, they will always be added.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True....Will add debug messages to the file log (no matter if they are displayed or logged in the mail log) False...Will not add debug messages to the file log (no matter if they are displayed or logged in the mail log) null or not specified...The adding of debug messages depends on the AsOutput switch. If the AsOutput switch is present, then debug messages will only be added if they are displayed, if the AsOutput switch is absent, they will always be added.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 10
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True....Will add information messages to the file log (no matter if they are displayed or logged in the mail log) False...Will not add information messages to the file log (no matter if they are displayed or logged in the mail log) null or not specified...The adding of information messages depends on the AsOutput switch. If the AsOutput switch is present, then information messages will only be added if they are displayed, if the AsOutput switch is absent, they will always be added.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 11
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not store the logs in a file, this switch is mutally exclusive with the NoTextLog switch (only one of those can be provided)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not store the logs in text form, this switch is mutally exclusive with the NoFileLog switch (only one of those can be provided)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not automatically add a timestamp to the beginning of each line in the log file. If this switch is set, use the -AddTimestamp switch on individual log calls to add a timestamp if needed.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will add the computer name in front of the log file name, followed by an underscore (will also be in front of the script name if UseScriptPrefix switch is set too)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will add the script name in front of the log file name, followed by an underscore.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will ignore LogName, UseScriptPrefix, UseComputerPrefix and NoDateTimeFormat
and use the following name for the logfile:
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not interprete LogName as a datetime format (and no letters will have to be escaped with backslashes)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Deletes an existing log file if it already exists. Otherwise new log messages will be appended at the end of the log file.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...For all message types for which no LogPreference was set (or for which the LogPreference is null) the message will only be added if it is displayed to the user (or would be displayed to the user if it is an automatic script) according to its environment variable. False/Absent...For all message types for which no LogPreference was set (or for which the LogPreference is null) the message will always be added regardless if it is displayed to the user (or would be displayed to the user if it is an automatic script) according to its environment variable.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will log regardless of -WhatIf switch of calling script False/Absent...Will only log if -WhatIf switch is not present in calling script
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None
Starts logging process for mail log.
Start-MailLog [[-ConfigurationName] <String>] [[-CredentialsFile] <String>]
[[-LogPreference_MailError] <Boolean>] [[-LogPreference_MailHost] <Boolean>]
[[-LogPreference_MailOutput] <Boolean>] [[-LogPreference_MailVerbose] <Boolean>]
[[-LogPreference_MailWarning] <Boolean>] [[-LogPreference_MailDebug] <Boolean>]
[[-LogPreference_MailInformation] <Boolean>] [-AddTimestamp] [-AsOutput] [-InitCredentials] [-Force] [-WhatIf]
[-Confirm] [<CommonParameters>]
Once this function has been called, the Write-ErrorLog etc. functions will add lines to a mail text that can later on be sent by mail with the Send-Log command.
Name of the configuration to initialize with these settings. The default will be DefaultMailLog.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: $script:__Constant_DefaultGlobalMailLogName__
Accept pipeline input: False
Accept wildcard characters: False
File to store mailing credentials in and read mailing credentials from (for access to the smtp server). Information will be stored in the XML file format. If no path for a credentials file was provided, the credentials of the script execution will be used to connect to the smtp server.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True....Will add error messages to the log mail text (no matter if they are displayed or logged in the file log) False...Will not add error messages to the log mail text (no matter if they are displayed or logged in the file log) null or not specified...The adding of error messages depends on the AsOutput switch. If the AsOutput switch is present, then error messages will only be added if they are displayed, if the AsOutput switch is absent, they will always be added.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True....Will add host messages to the log mail text (no matter if they are displayed or logged in the file log) False...Will not add host messages to the log mail text (no matter if they are displayed or logged in the file log) null or not specified...The adding of host messages depends on the AsOutput switch. If the AsOutput switch is present, then host messages will only be added if they are displayed, if the AsOutput switch is absent, they will always be added.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True....Will add output messages to the log mail text (no matter if they are displayed or logged in the file log) False...Will not add output messages to the log mail text (no matter if they are displayed or logged in the file log) null or not specified...The adding of output messages depends on the AsOutput switch. If the AsOutput switch is present, then output messages will only be added if they are displayed, if the AsOutput switch is absent, they will always be added.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True....Will add verbose messages to the log mail text (no matter if they are displayed or logged in the file log) False...Will not add verbose messages to the log mail text (no matter if they are displayed or logged in the file log) null or not specified...The adding of verbose messages depends on the AsOutput switch. If the AsOutput switch is present, then verbose messages will only be added if they are displayed, if the AsOutput switch is absent, they will always be added.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True....Will add warning messages to the log mail text (no matter if they are displayed or logged in the file log) False...Will not add warning messages to the log mail text (no matter if they are displayed or logged in the file log) null or not specified...The adding of warning messages depends on the AsOutput switch. If the AsOutput switch is present, then warning messages will only be added if they are displayed, if the AsOutput switch is absent, they will always be added.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True....Will add debug messages to the log mail text (no matter if they are displayed or logged in the file log) False...Will not add debug messages to the log mail text (no matter if they are displayed or logged in the file log) null or not specified...The adding of debug messages depends on the AsOutput switch. If the AsOutput switch is present, then debug messages will only be added if they are displayed, if the AsOutput switch is absent, they will always be added.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True....Will add information messages to the log mail text (no matter if they are displayed or logged in the file log) False...Will not add information messages to the log mail text (no matter if they are displayed or logged in the file log) null or not specified...The adding of information messages depends on the AsOutput switch. If the AsOutput switch is present, then information messages will only be added if they are displayed, if the AsOutput switch is absent, they will always be added.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will add a timestamp at the beginning of each line False/Absent...Will not add a timestamp at the beginning of each line
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...For all message types for which no LogPreference was set (or for which the LogPreference is null) the message will only be added if it is displayed to the user (or would be displayed to the user if it is an automatic script) according to its environment variable. False/Absent...For all message types for which no LogPreference was set (or for which the LogPreference is null) the message will always be added regardless if it is displayed to the user (or would be displayed to the user if it is an automatic script) according to its environment variable.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...The script will ask for the credentials to use for mail sending, store them in the credentials file and will then immediatly exit the script. Used to either set up credentials file for the first time, or change/renew the credentials in the credential file, without performing the actual task by the script. The -WhatIf switch cannot be used to make sure the script is not performing its task, because it will also prevent the script from saving the credentials to the credentials file. This switch is ignored if the CredentialsFile parameter is not provided.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will log regardless of -WhatIf switch of calling script False/Absent...Will only log if -WhatIf switch is not present in calling script
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None
If the credentials file cannot be found, it will ask the user for the credentials and stores it in the credential file. For first use or to change the credentials, use the -InitCredentials switch, which will force storing new credentials and exits the script immediately after saving the credentials without executing the rest of the script. This is because the -WhatIf switch cannot be used to make sure the script is not performing its task, because it will also prevent the script from saving the credentials to the credentials file.
Stops logging process for log file.
Stop-Log [[-ConfigurationName] <String[]>] [-KeepLoggingFile] [-KeepLoggingText] [-WhatIf] [-Confirm]
[<CommonParameters>]
One or more names of the configurations to write to. Default is $null and all configurations will be stopped.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not stop file logging False/Absent...Will stop file logging
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not stop text logging False/Absent...Will stop text logging
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None
Once this function has been called, the Write-ErrorLog etc. functions will not add any more lines to the file log.
Emulates Write-Debug but also logs the message in the file and mail log (if applicable)
Write-DebugLog [-Message] <Object> [[-ConfigurationName] <String[]>] [-NoOut] [-NoLog] [-NoMail]
[-AddTimestamp] [-Force] [-ForceMail] [-WhatIf] [-Confirm] [<CommonParameters>]
The debug message
Type: Object
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
One or more names of the configurations to which to write to. Default is $null and the message will be written to all running log configurations.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not print the debug message to the console
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not log the debug message to the log file
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not add the debug message to the mail log
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will add a timestamp to each line of the message string, regardless if the -NoTimestamp flag in Start-Log was set False/Absent...Will only add a timestamp to each line of the message string if the -NoTimestamp flag in Start-Log was not set (which is the default behaviour)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will write the message to the log file, regardless of the rules for debug message logging (as set on Start-Log call) False/Absent...Will only write the message to the log file if debug message logging rules apply (as set on Start-Log call)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will write the message to the mail log, regardless of the rules for debug message logging (as set on Start-MailLog call) False/Absent...Will only write the message to the mail log if debug message logging rules apply (as set on Start-MailLog call)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None (Prints debug message)
Can recieve the message through pipe
Emulates Write-Error but also logs the error in the file and mail log (if applicable)
Write-ErrorLog [[-Message] <String>] [[-Category] <ErrorCategory>] [[-Err] <ErrorRecord>]
[[-ConfigurationName] <String[]>] [-NoOut] [-NoLog] [-NoMail] [-AddTimestamp] [-NoErrorDetails] [-Force]
[-ForceMail] [-WhatIf] [-Confirm] [<CommonParameters>]
.\Update-Month.ps1 -inputpath C:\Data\January.csv
.\Update-Month.ps1 -inputpath C:\Data\January.csv -outputPath C:\Reports\2009\January.csv
Additional error message
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Error category of type [System.Management.Automation.ErrorCategory] (default is NotSpecified)
Type: ErrorCategory
Parameter Sets: (All)
Aliases:
Accepted values: NotSpecified, OpenError, CloseError, DeviceError, DeadlockDetected, InvalidArgument, InvalidData, InvalidOperation, InvalidResult, InvalidType, MetadataError, NotImplemented, NotInstalled, ObjectNotFound, OperationStopped, OperationTimeout, SyntaxError, ParserError, PermissionDenied, ResourceBusy, ResourceExists, ResourceUnavailable, ReadError, WriteError, FromStdErr, SecurityError, ProtocolError, ConnectionError, AuthenticationError, LimitsExceeded, QuotaExceeded, NotEnabled
Required: False
Position: 2
Default value: NotSpecified
Accept pipeline input: False
Accept wildcard characters: False
Error object (as recieved by catch block), can also be recieved through pipe
Type: ErrorRecord
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
One or more names of the configurations to which to write to. Default is $null and the message will be written to all running log configurations.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not print the error message to the console
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not log the error message to the log file
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not add the error message to the mail log
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will add a timestamp to each line of the message string, regardless if the -NoTimestamp flag in Start-Log was set False/Absent...Will only add a timestamp to each line of the message string if the -NoTimestamp flag in Start-Log was not set (which is the default behaviour)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not add details of the original error object to the error message False/Absent...Will add details of the original error object to the error message
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will write the message to the log file, regardless of the rules for error message logging (as set on Start-Log call) False/Absent...Will only write the message to the log file if error message logging rules apply (as set on Start-Log call)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will write the message to the mail log, regardless of the rules for error message logging (as set on Start-MailLog call) False/Absent...Will only write the message to the mail log if error message logging rules apply (as set on Start-MailLog call)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None (Prints error message)
Can recieve error object through pipe, example call in catch block: catch { $_ | Write-ErrorLog "Example error message" }
Emulates Write-Host but also logs the message in the file and mail log (if applicable)
Write-HostLog [-Message] <Object> [[-ConfigurationName] <String[]>] [-NoNewline]
[-ForegroundColor <ConsoleColor>] [-BackgroundColor <ConsoleColor>] [-NoOut] [-NoLog] [-NoMail]
[-AddTimestamp] [-Force] [-ForceMail] [-WhatIf] [-Confirm] [<CommonParameters>]
The host message
Type: Object
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
One or more names of the configurations to which to write to. Default is $null and the message will be written to all running log configurations.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Same as NoNewline switch in Write-Host cmdlet
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Same as ForegroundColor parameter in Write-Host cmdlet (only applies to message output to console, not logging)
Type: ConsoleColor
Parameter Sets: (All)
Aliases:
Accepted values: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White
Required: False
Position: Named
Default value: (Get-ConsoleForegroundColor)
Accept pipeline input: False
Accept wildcard characters: False
Same as BackgroundColor parameter in Write-Host cmdlet (only applies to message output to console, not logging)
Type: ConsoleColor
Parameter Sets: (All)
Aliases:
Accepted values: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White
Required: False
Position: Named
Default value: (Get-ConsoleBackgroundColor)
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not print the host message to the console
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not log the host message to the log file
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not add the host message to the mail log
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will add a timestamp to each line of the message string, regardless if the -NoTimestamp flag in Start-Log was set False/Absent...Will only add a timestamp to each line of the message string if the -NoTimestamp flag in Start-Log was not set (which is the default behaviour)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will write the message to the log file, regardless of the rules for host message logging (as set on Start-Log call) False/Absent...Will only write the message to the log file if host message logging rules apply (as set on Start-Log call)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will write the message to the mail log, regardless of the rules for host message logging (as set on Start-MailLog call) False/Absent...Will only write the message to the mail log if host message logging rules apply (as set on Start-MailLog call)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None (Prints host message)
Can recieve the message through pipe
Emulates Write-Information but also logs the message in the file and mail log (if applicable)
Write-InformationLog [-Message] <Object> [[-ConfigurationName] <String[]>] [-NoOut] [-NoLog] [-NoMail]
[-AddTimestamp] [-Force] [-ForceMail] [-WhatIf] [-Confirm] [<CommonParameters>]
The information message
Type: Object
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
One or more names of the configurations to which to write to. Default is $null and the message will be written to all running log configurations.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not print the information message to the console
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not log the information message to the log file
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not add the information message to the mail log
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will add a timestamp to each line of the message string, regardless if the -NoTimestamp flag in Start-Log was set False/Absent...Will only add a timestamp to each line of the message string if the -NoTimestamp flag in Start-Log was not set (which is the default behaviour)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will write the message to the log file, regardless of the rules for information message logging (as set on Start-Log call) False/Absent...Will only write the message to the log file if information message logging rules apply (as set on Start-Log call)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will write the message to the mail log, regardless of the rules for information message logging (as set on Start-MailLog call) False/Absent...Will only write the message to the mail log if information message logging rules apply (as set on Start-MailLog call)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None (Prints information message)
Can recieve the message through pipe
Emulates Write-Output but also logs the message in the file and mail log (if applicable)
Write-OutputLog [-Message] <Object> [[-ConfigurationName] <String[]>] [-NoOut] [-NoLog] [-NoMail]
[-AddTimestamp] [-Force] [-ForceMail] [-WhatIf] [-Confirm] [<CommonParameters>]
The output message
Type: Object
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
One or more names of the configurations to which to write to. Default is $null and the message will be written to all running log configurations.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not print the output message to the console
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not log the output message to the log file
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not add the output message to the mail log
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will add a timestamp to each line of the message string, regardless if the -NoTimestamp flag in Start-Log was set False/Absent...Will only add a timestamp to each line of the message string if the -NoTimestamp flag in Start-Log was not set (which is the default behaviour)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will write the message to the log file, regardless of the rules for output message logging (as set on Start-Log call) False/Absent...Will only write the message to the log file if output message logging rules apply (as set on Start-Log call)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will write the message to the mail log, regardless of the rules for output message logging (as set on Start-MailLog call) False/Absent...Will only write the message to the mail log if output message logging rules apply (as set on Start-MailLog call)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None (Prints output message)
Can recieve the message through pipe
Emulates Write-Verbose but also logs the message in the file and mail log (if applicable)
Write-VerboseLog [-Message] <Object> [[-ConfigurationName] <String[]>] [-NoOut] [-NoLog] [-NoMail]
[-AddTimestamp] [-Force] [-ForceMail] [-WhatIf] [-Confirm] [<CommonParameters>]
The verbose message
Type: Object
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
One or more names of the configurations to which to write to. Default is $null and the message will be written to all running log configurations.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not print the verbose message to the console
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not log the verbose message to the log file
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not add the verbose message to the mail log
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will add a timestamp to each line of the message string, regardless if the -NoTimestamp flag in Start-Log was set False/Absent...Will only add a timestamp to each line of the message string if the -NoTimestamp flag in Start-Log was not set (which is the default behaviour)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will write the message to the log file, regardless of the rules for verbose message logging (as set on Start-Log call) False/Absent...Will only write the message to the log file if verbose message logging rules apply (as set on Start-Log call)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will write the message to the mail log, regardless of the rules for verbose message logging (as set on Start-MailLog call) False/Absent...Will only write the message to the mail log if verbose message logging rules apply (as set on Start-MailLog call)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None (Prints verbose message)
Can recieve the message through pipe
Emulates Write-Warning but also logs the message in the file and mail log (if applicable)
Write-WarningLog [-Message] <Object> [[-ConfigurationName] <String[]>] [-NoOut] [-NoLog] [-NoMail]
[-AddTimestamp] [-Force] [-ForceMail] [-WhatIf] [-Confirm] [<CommonParameters>]
The warning message
Type: Object
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
One or more names of the configurations to which to write to. Default is $null and the message will be written to all running log configurations.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not print the warning message to the console
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not log the warning message to the log file
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will not add the warning message to the mail log
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will add a timestamp to each line of the message string, regardless if the -NoTimestamp flag in Start-Log was set False/Absent...Will only add a timestamp to each line of the message string if the -NoTimestamp flag in Start-Log was not set (which is the default behaviour)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will write the message to the log file, regardless of the rules for warning message logging (as set on Start-Log call) False/Absent...Will only write the message to the log file if warning message logging rules apply (as set on Start-Log call)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
True/Present...Will write the message to the mail log, regardless of the rules for warning message logging (as set on Start-MailLog call) False/Absent...Will only write the message to the mail log if warning message logging rules apply (as set on Start-MailLog call)
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None (Prints warning message)
Can recieve the message through pipe