MrPig91 / PSChiaPlotter

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

Drive letter validation #112

Closed Jacek-ghub closed 3 years ago

Jacek-ghub commented 3 years ago

Hi, can we modify drive letter validation? What is the point on Windows to check whether drive letter is capital or lover case? Does it really make the code that much easier, that the end users need to think which one to use?

Also, if there is a validation there, why it doesn't run on saving a job, just on starting one, why is not running on leaving the field?

I typed all my drives in lower case, save that new job, tried to start - bummer, first warning. So, I fixed all those letters that I could see, saved it, and tried to start that job - bummer, there is also a destination panel with those lower case letters, so back to fixing.

I know, that is a bit of whining, but still, the software job is to make the human job easier.

Here is the picture with the error I got:

drive-letter

Thank you, Jacek

MrPig91 commented 3 years ago

I didn't realize this was the case as most of all powerhshell is case insensitive. However, using the string method of StartWith is case sensitive is apparently case sensitive which makes sense now that I think about it since it is using a method a .net class. This was unintentional, but it validates the start of the path to make the user is entering in a valid path on the drive and not another drive since that would mess up how the plot manager checks for for freespace. I can change the line for this validation to the one below and it should fix this issue (except using the variables in the code).

"d:\".StartsWith("D",[System.StringComparison]::CurrentCultureIgnoreCase)

Jacek-ghub commented 3 years ago

Super, I though that it was just an omission. If you could also add validation when saving a job, that would be more friendly as well.

MrPig91 commented 3 years ago

The drive letter case sensitivity issue has been resolved in the latest update.