Skip to content

Commit

Permalink
Finish adding temp debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
rcmaehl committed Jan 17, 2024
1 parent 835d90c commit 552b948
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions WhyNotWin11.au3
Expand Up @@ -1214,34 +1214,44 @@ Func OutputResults(ByRef $aResults, $aOutput)
$sFile = $aOutput[2]
Else
$sFile = @ScriptDir & "\" & $aOutput[2]
FileWrite(".\debug.log", "Set full path to " & $sFile & @CRLF)
EndIf
$hFile = FileOpen($sFile, $FO_CREATEPATH + $FO_OVERWRITE)
FileWrite(".\debug.log", "FileOpen Returned: " & $hFile & @CRLF)
FileWrite($hFile, "Results for " & @ComputerName & @CRLF)
For $iLoop = 0 To 10 Step 1
FileWrite($hFile, $aLabel[$iLoop] & @TAB & $aResults[$iLoop][0] & @TAB & $aResults[$iLoop][1] & @TAB & $aResults[$iLoop][2] & @CRLF)
Next
FileWrite(".\debug.log", "Wrote Results: " & _ArrayToString($aResults) & @CRLF)
FileClose($hFile)
Case "csv"
FileWrite(".\debug.log", "Spreadsheet Path Called" & @CRLF)
If StringInStr($aOutput[2], ":") Or StringInStr($aOutput[2], "\\") Then
$sFile = $aOutput[2]
Else
$sFile = @ScriptDir & "\" & $aOutput[2]
FileWrite(".\debug.log", "Set full path to " & $sFile & @CRLF)
EndIf
If Not FileExists($sFile) Then
FileWrite(".\debug.log", "Found Existing CSV" & @CRLF)
$hFile = FileOpen($sFile, $FO_CREATEPATH + $FO_OVERWRITE)
FileWrite(".\debug.log", "FileOpen Returned: " & $hFile & @CRLF)
FileWrite($hFile, "Hostname")
For $iLoop = 0 To 10 Step 1
FileWrite($hFile, "," & $aLabel[$iLoop])
Next
FileWrite($hFile, @CRLF)
FileWrite(".\debug.log", "Wrote Headers" & @CRLF)
Else
FileWrite(".\debug.log", "Found No Existing CSV" & @CRLF)
$hFile = FileOpen($sFile, $FO_APPEND)
FileWrite(".\debug.log", "FileOpen Returned: " & $hFile & @CRLF)
EndIf
FileWrite($hFile, @ComputerName)
For $iLoop = 0 To 10 Step 1
FileWrite($hFile, "," & $aResults[$iLoop][0])
Next
FileWrite(".\debug.log", "Wrote Results: " & _ArrayToString($aResults) & @CRLF)
FileWrite($hFile, @CRLF)
FileClose($hFile)
Case Else
Expand Down

0 comments on commit 552b948

Please sign in to comment.