sp00n / corecycler

Script to test single core stability, e.g. for PBO & Curve Optimizer on AMD Ryzen or overclocking/undervolting on Intel processors
Other
663 stars 30 forks source link

analyze_prime95_logfile.ps1 script does not accept filename without " ..\<path>" #46

Open joseph373334 opened 1 year ago

joseph373334 commented 1 year ago

So everytime I tried running the analyze the prime95 logs I kept getting the error "Could not find log file....try entering as " analyze_prime95_logfile.ps1 " and even though it was entered as such, or with full path, it would error.

THIS IS ITALICIZED and I Like it I have corrected the IF statement (that did not appear to work with the "-contains" switch). The function block at Lines 216 - 223 I have replaced:

if ( $logFileName -notcontains '\' ) {
    $filePath = $logFileName
}
else {
    # The full path of the log file
    $folder   = (Resolve-Path $logFileDirectory).ToString()
    $folder  += $(if ($folder.SubString($folder.Length-1) -ne '\') { '\' })
    $filePath = (Resolve-Path $logFileDirectory).ToString() + $logFileName
}

WITH:

 if ( $logFileName.Contains('\')) {
    # If the argument/log-filename contains back slashes, ignore the $logFileDirectory variable
    $filePath = $logFileName
} else {
        # If the log file name DOESNOT contain backslashes use Variables
        # The full path of the log file
    $folder   = (Resolve-Path $logFileDirectory).ToString()
    $folder  += $(if ($folder.SubString($folder.Length-1) -ne '\') { '\' })
    $filePath = (Resolve-Path $logFileDirectory).ToString() + $logFileName
}