Skip to content

Commit

Permalink
Fix null terminator at the end of DHCP option value
Browse files Browse the repository at this point in the history
  • Loading branch information
okieselbach committed Mar 9, 2018
1 parent 66a6fae commit 376af38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ else {
New-Item -Type String -Path $registryPath | Out-Null
}
$Name = "DOGroupId"
$value = $optionIdValue
$value = $optionIdValue.SubString(0, $optionIdValue.Length - 1)
New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType string -Force | Out-Null
}
}
Expand Down
7 changes: 4 additions & 3 deletions ManagementExtension-Samples/DOScript/Register-DOScript.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<#
Version: 1.0
Version: 1.1
Author: Oliver Kieselbach
Script: Register-DOScript.ps1
Description:
Register a PS script as scheduled task to query DHCP for option 234 to get Group ID GUID
Release notes:
Version 1.0: Original published version.
Version 1.0: Original published version.
Version 1.1: Fix, removed null terminator at the end of DHCP option value provided by DHCPOption.exe
The script is provided "AS IS" with no warranties.
#>
Expand Down Expand Up @@ -70,7 +71,7 @@ else {
New-Item -Type String -Path $registryPath | Out-Null
}
$Name = "DOGroupId"
$value = $optionIdValue
$value = $optionIdValue.SubString(0, $optionIdValue.Length - 1)
New-ItemProperty -Path $registryPath -Name $name -Value $value -PropertyType string -Force | Out-Null
}
}
Expand Down

0 comments on commit 376af38

Please sign in to comment.