MrPig91 / PSChiaPlotter

A repo for powershell module that helps Chia Plotting
MIT License
181 stars 47 forks source link

Get-ChiaPlotProgress Error #35

Closed orbitrod closed 3 years ago

orbitrod commented 3 years ago

I am trying to run the Get-ChiaPlotProgress command and I am getting the following error.

PS C:\Users\rk\.chia\mainnet\plotter> Get-ChiaPlotProgress

cmdlet Get-ChiaPlotProgress at command pipeline position 1
Supply values for the following parameters:
LogPath: C:\Users\rk\.chia\mainnet\plotter
Get-Content : Access to the path 'C:\Users\rk\.chia\mainnet\plotter' is denied.
At C:\Program Files\WindowsPowerShell\Modules\PSChiaPlotter\1.0.14\PSChiaPlotter.psm1:207 char:16
+     $LogFile = Get-Content -Path $LogPath
+                ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (C:\Users\rk\.chia\mainnet\plotter:String) [Get-Content], Unauthorized
   AccessException
    + FullyQualifiedErrorId : GetContentReaderUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetContentCommand

Cannot convert value "∞" to type "System.Int32". Error: "Value was either too large or too small for an Int32."
At C:\Program Files\WindowsPowerShell\Modules\PSChiaPlotter\1.0.14\PSChiaPlotter.psm1:216 char:9
+         $secondsRemaining = [int]($Est_TimeRemaining - $ElaspedTime.T ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvalidCastIConvertible

New-TimeSpan : Cannot bind parameter 'Seconds' to the target. Exception setting "Seconds": "Cannot convert null to
type "System.Int32"."
At C:\Program Files\WindowsPowerShell\Modules\PSChiaPlotter\1.0.14\PSChiaPlotter.psm1:221 char:55
+ ...           EST_TimeReamining = New-TimeSpan -Seconds $secondsRemaining
+                                                         ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [New-TimeSpan], ParameterBindingException
    + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.NewTimeSpanCommand

Progress Phase   ElaspedTime         EST_TimeReamining
-------- -----   -----------         -----------------
 -485.45 Phase 2 11.11:30:16.9325603 -13.20:15:24

image

MrPig91 commented 3 years ago

You supplied a path to a directory when it is expecting a file path to the log file. I will add a check to make sure the path leads to a log file and not a directory. Thank you for this submission.

orbitrod commented 3 years ago

Oooh, I misunderstood. I thought this command checked the progress of all logs in a directory.

MrPig91 commented 3 years ago

I can see how that could happen.