-
Notifications
You must be signed in to change notification settings - Fork 134
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
xRegistry: Fixed issue unable to create registry value with data zero. (Fixes #276) #281
Conversation
Hi @Amedama96, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
@kwirkykat |
@Amedama96 CLA bot is having issues. I'm going to close the PR and then re-open it to try to get it to cooperate. |
Hi @Amedama96, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! The agreement was validated by Microsoft and real humans are currently evaluating your PR. TTYL, MSBOT; |
Review status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion. DSCResources/MSFT_xRegistryResource/MSFT_xRegistryResource.psm1, line 1134 at r1 (raw file):
If we repeat this code 3 times, the code should be a function, with tests. Comments from Reviewable |
Comments withdrawn. |
Hi @LiamFisher92 This is the code for parsing. (prefix '0x' has removed already) for ($i = 0 ; $i -lt ($val.Length-1) ; $i = $i+2)
{
$byteArray += [System.Byte]::Parse($val.Substring($i, 2), 'HexNumber')
} [System.Byte]::Parse('00', 'HexNumber') give you byte (0). These results are correct, aren't you? |
I beg your pardon. Int32.TryParse with [System.Globalization.NumberStyles]::HexNumber handles this. |
@TravisEz13 It 'Should create a new binary registry key value with data 0' {
$valueName = 'TestValue'
$valueData = '0x00'
$valueType = 'Binary'
... |
Sadly, I found two additional related issues. Issue AIf you specify the ValueData with prefix '0x', Test-TargetResource always return $false. even if the reg value is desired. xRegistry RegBinary_PrefixIssue
{
Ensure = "Present"
Key = "HKEY_LOCAL_MACHINE\SYSTEM\Tests"
ValueName = "TestValue"
ValueData = "0x0F" # No problem happend if you set ValueData="0F",
ValueType = "Binary"
} Issue BWhen the current reg binary value is '0000'. |
* xPackage fixes and updates * Replaces Out-Null with $null assignments * Resolves README.md merge conflict
Add a function 'Remove-PrefixString' and replace redundant codes.
Fix When the ValueData starts with '0x', Test-TargetResource always returned $false
When the current reg binary value is '0000' and ValueData is '00', Test-TargetResource returned wrong comparison result
I have resolved @TravisEz13 review and fixed additional issues. Did My PR mixed with @iainbrighton 's another commit ? |
@@ -433,7 +435,7 @@ try | |||
$msiUrl = "$baseUrl" + "package.msi" | |||
New-MockFileServer -FilePath $script:msiLocation -Https | |||
|
|||
# Test pipe connection as testing server readiness | |||
# Test pipe connection as testing server reasdiness |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix misspelling
@@ -1279,11 +1286,12 @@ function Set-TargetResource | |||
$startInfo.Arguments += ' /log "{0}"' -f $LogPath | |||
} | |||
|
|||
$startInfo.Arguments += " /quiet" | |||
$startInfo.Arguments += " /quiet /norestart" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch.
{ | ||
$process.BeginOutputReadLine() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
functional regression of the logstream functionality (but looking at the code I'm not 100% sure it worked)
function Register-PInvoke | ||
{ | ||
$programSource = @' | ||
using System; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you get this code from another resource? If so, please add a comment about where you got it from, please?
Review status: 0 of 5 files reviewed at latest revision, 4 unresolved discussions. DSCResources/MSFT_xPackageResource/MSFT_xPackageResource.psm1, line 1289 at r4 (raw file): Previously, TravisEz13 (Travis Plunk) wrote…
Thanks! Not sure how the xPackage changes ended up in this PR as they were all merged in #278 ? DSCResources/MSFT_xPackageResource/MSFT_xPackageResource.psm1, line 1727 at r4 (raw file): Previously, TravisEz13 (Travis Plunk) wrote…
This comes from older versions of the xPackage resource! Comments from Reviewable |
Reviewed 2 of 2 files at r1. DSCResources/MSFT_xPackageResource/MSFT_xPackageResource.psm1, line 1727 at r4 (raw file): Previously, iainbrighton (Iain Brighton) wrote…
Please add a comment to the code of where the code from. And probably file an issue that we should have a common module to do this. Comments from Reviewable |
Review status: 0 of 5 files reviewed at latest revision, 4 unresolved discussions. DSCResources/MSFT_xRegistryResource/MSFT_xRegistryResource.psm1, line 1134 at r1 (raw file): Previously, TravisEz13 (Travis Plunk) wrote…
Added helper function 'Remove-PrefixString' Comments from Reviewable |
Reviewed 3 of 4 files at r2, 2 of 2 files at r4. Comments from Reviewable |
Those xRegistry resource issues fixed and merged #299 by @kwirkykat |
Fix #276
Modified the logic to delete the first '0x' of the string.
This change is