Private/New-InformationLog.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
function New-InformationLog { [CmdletBinding()] Param( [Parameter(Mandatory=$true,HelpMessage="LogPath",Position=0)] [String]$logPath, [Parameter(Mandatory=$true,HelpMessage="Message",Position=1)] [String]$message, [Parameter(Mandatory=$true,HelpMessage="Color",Position=2)] [String]$color ) $datetime=Get-Date -Format "HH.mm.ss.ffff_dd.MM.yyyy" "[$datetime] $message" >> $logPath Write-Host "[$datetime] $message " -ForegroundColor $color } |