how would i write a log file, and do a throw in the same line ?
Function LogWrite
{
Param ([string]$logstring)
Add-content $Logfile -value $logstring
}
This works, but dont look so good in the code:
LogWrite "$ProgramName Not Installed" throw "$ProgramName Not Installed"