-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xAccessPath: Access Path not found - Fixes #121 #126
Conversation
Added refresh of PS Drive using a try/catch block.
To fix issue 121 - Access Path not found.
Verbose Messaging in support of PSDrive refreshing.
Codecov Report
@@ Coverage Diff @@
## dev #126 +/- ##
==================================
- Coverage 94% 94% -1%
==================================
Files 5 5
Lines 671 680 +9
==================================
+ Hits 636 641 +5
- Misses 35 39 +4 |
Thank you very much @positivism1 for submitting this! It is greatly appreciated and a really awesome job. Review comments and changes are completely normal and expected part of the process 🍰 We all get them (any of the people who have reviewed my code will agree 😉 ). Keep up the awesome work! If you make the changes below and just push back to your branch then hit the Reviewable button on your PR you will be able to click Done on any of the changes you've made and I can continue the review. Reviewed 3 of 3 files at r1. CHANGELOG.md, line 11 at r1 (raw file):
Please remove extra space between Also Modules/xStorage/DSCResources/MSFT_xDiskAccessPath/MSFT_xDiskAccessPath.psm1, line 532 at r1 (raw file):
I think this code actually needs to be moved into the So, I reckon this code needs to go in somewhere around here: Convert to lower case Also, the alignment seems a bit off on this code block and there are a few extra spaces at the end of these lines. The easiest way to fix it is to use Visual Studio Code format document feature. I wrote a quick blog post showing how to use it: Modules/xStorage/DSCResources/MSFT_xDiskAccessPath/MSFT_xDiskAccessPath.psm1, line 534 at r1 (raw file):
Please use lower case for first letter of local variables. E.g. $AccessPathDisk = $AccessPath.split(":")[0] Modules/xStorage/DSCResources/MSFT_xDiskAccessPath/MSFT_xDiskAccessPath.psm1, line 539 at r1 (raw file):
You could assign this to $null because the result will never be used. Visual Studio Code will underline this as a recommendation 😁 E.g. $null = Get-PSDrive $AccessPathDisk -ErrorAction Stop Modules/xStorage/DSCResources/MSFT_xDiskAccessPath/MSFT_xDiskAccessPath.psm1, line 541 at r1 (raw file):
Please use lower case Modules/xStorage/DSCResources/MSFT_xDiskAccessPath/MSFT_xDiskAccessPath.psm1, line 550 at r1 (raw file):
Assigning to $null is faster in older versions of PS (5.1 and below) rather than piping, so can you change to: $null = Get-PSDrive Also, how come this second Modules/xStorage/DSCResources/MSFT_xDiskAccessPath/en-us/MSFT_xDiskAccessPath.strings.psd1, line 1 at r1 (raw file): Can you remove this extra blank line at the top here? Modules/xStorage/DSCResources/MSFT_xDiskAccessPath/en-us/MSFT_xDiskAccessPath.strings.psd1, line 37 at r1 (raw file):
Can you remove this extra blank line here? Comments from Reviewable |
Thank you! this is great, I will get to it as soon as I can. From what I remember from my testing, I put the change into Test-TargetResource because that is where the whole thing falls in a heap, when the test-path runs, it can't find the folder because psdrive need refreshing. |
Getting back into this now. Apologies, have been away. |
The psdrive refresh is in the Test-TargetResource because this is where the error occurs. This code: Is the thing that does the work, only if this line errors.. Without get-psdrive in catch block (error): With get-psdrive catch block (successful): Thanks, I will review the code, make changes and set it to Reviewable. |
Hi @positivism1 - it looks like you've got some merge conflicts that need to be fixed. These will have been caused when another PR got merged before yours. If you can go into Reviewable and click Done on any changes you've completed and the click Publish that will allow me to acknowledge any required changes. Thanks again for your hard word! |
ahh yep ok thanks :-) I will try get this Publish button to work. Reviewed 1 of 3 files at r1, 1 of 1 files at r2, 2 of 2 files at r3. CHANGELOG.md, line 11 at r1 (raw file): Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Done. Modules/xStorage/DSCResources/MSFT_xDiskAccessPath/MSFT_xDiskAccessPath.psm1, line 532 at r1 (raw file): Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Done. Modules/xStorage/DSCResources/MSFT_xDiskAccessPath/MSFT_xDiskAccessPath.psm1, line 534 at r1 (raw file): Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Done. Modules/xStorage/DSCResources/MSFT_xDiskAccessPath/MSFT_xDiskAccessPath.psm1, line 539 at r1 (raw file): Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Done. Modules/xStorage/DSCResources/MSFT_xDiskAccessPath/MSFT_xDiskAccessPath.psm1, line 541 at r1 (raw file): Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Done. Modules/xStorage/DSCResources/MSFT_xDiskAccessPath/MSFT_xDiskAccessPath.psm1, line 550 at r1 (raw file): Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
This is the one that refreshes the psdrives, the one above tests if the drives are updated or not. Modules/xStorage/DSCResources/MSFT_xDiskAccessPath/en-us/MSFT_xDiskAccessPath.strings.psd1, line 1 at r1 (raw file): Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Done. Modules/xStorage/DSCResources/MSFT_xDiskAccessPath/en-us/MSFT_xDiskAccessPath.strings.psd1, line 37 at r1 (raw file): Previously, PlagueHO (Daniel Scott-Raynsford) wrote…
Done. Comments from Reviewable |
Hi @positivism1 - are you able to resolve the merge conflicts on this one? I merged another PR in which caused the conflicts. |
Yes, would love to, but not exactly sure how. do I need to start again and do a new pull request? or do I manually somehow merge the changes? |
HI @positivism1 - merge conflicts are super common and easy to fix. What you need to do is rebase your branch with the upstream dev branch. Take a look at these instructions: https://github.com/PowerShell/DscResources/blob/master/GettingStartedWithGitHub.md#resolve-merge-conflicts Basically you'll bring the changes I've made to the upstream Dev branch into your branch, correct any merge conflicts and then push the changes back in. No need to create a new PR or anything. The challenge will be in your case I had made a non-trivial change to xDiskAccess path to fix a long standing bug so you'll need to figure out how to merge your changes into mine. This hopefully is very straight forward - but if not, tag me and I'll see if I can help point you in the right direction. |
Labeling this PR as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on the PR is taken up again. |
Superceded by #209 |
Pull Request (PR) description
This Pull Request (PR) fixes the following issues:
Fixes #121
Task list:
This change is