UcmPsTools Documentation
  • Welcome! - UcmPsTools
  • Using UcmPsTools
    • QuickStart
    • About UcmPSTools
    • Using UcmPsTools in your Automation
    • Cmdlet Reference
      • Accounts and Voice Apps
        • New-UcmOffice365User -todo
        • New-UcmTeamsResourceAccount - todo
      • Auditing and Planning
        • Measure-UcmOnPremNumberRange
      • Call Management
        • New-UcmCsFixedNumberDiversion
      • Connections and Modules
      • Licences and Service Plans
      • Reporting and Logging
        • Complete-UcmReport
        • Export-UcmCSVReport
        • Export-UcmHTMLReport
        • Initialize-UcmReport
        • New-UcmReportItem
        • New-UcmReportStep
        • Search-UcmCsOnPremNumberRange
        • Write-UcmLog
    • Example Scripts
  • UcmPsTools In Depth
    • More about UcmPsTools
    • Security In UcmPsTools
    • UcmPsTools Cmdlet Status Reporting
  • Contributing to UcmPsTools
    • New Function Rules
    • Pull Process
Powered by GitBook
On this page
  • Description
  • Parameters
  • Example
  1. Using UcmPsTools
  2. Cmdlet Reference
  3. Reporting and Logging

Write-UcmLog

Function to output messages to the console based on their severity and create log files

Description

Basic log file and user feedback function, allows for logging only, log levels logs hostname/time etc

Parameters

Message (Required)

The message to write

Path (optional)

The location of the logfile, will default to the script variable $Script:LogFileLocation if not specified

Severity

Sets the severity of the log message, Higher severities will call Write-Warning or Write-Error

Component

Used to track the module or function that called "Write-Log"

LogOnly

Forces Write-Log to not display anything to the user

Example

Write-Log -Message 'This is a log message' -Severity 3 -component 'Example Component' Writes a log file message and displays a warning to the user

Write-Log -Message 'This is a log message' -Severity 3 -component 'Example Component' 
# Writes a log file message and displays a warning to the user
PreviousSearch-UcmCsOnPremNumberRangeNextExample Scripts

Last updated 2 years ago