I am looking a way to get output the pointer (line number) from running powershell script and write into a selfmade Log-File.
function DebugMode {
param([int]$linenumber,[String]$message)
$Date = Get-Date -Format 'yyyyMMdd'
$logfilepath ="$scriptpath\Debug_$Date.log"
$Date + " - "+ $linenumber + " - " +$message | Out-File -FilePath $logfilepath -Append}