Private/Write-Log.ps1
function Write-Log { param ( [string]$Message, [string]$LogPath ) if ($LogPath) { Add-Content -Path $LogPath -Value "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') - $Message" } Write-Information $Message } |