{"id":19954035,"url":"https://github.com/mkht/dhcpclient-ps","last_synced_at":"2026-01-02T20:28:18.152Z","repository":{"id":37724556,"uuid":"363995626","full_name":"mkht/DHCPClient-PS","owner":"mkht","description":"PowerShell DHCP Client module","archived":false,"fork":false,"pushed_at":"2025-11-16T14:33:18.000Z","size":160,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-16T15:20:38.329Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkht.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-03T16:40:11.000Z","updated_at":"2025-11-16T14:33:22.000Z","dependencies_parsed_at":"2022-09-06T09:12:08.031Z","dependency_job_id":null,"html_url":"https://github.com/mkht/DHCPClient-PS","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/mkht/DHCPClient-PS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkht%2FDHCPClient-PS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkht%2FDHCPClient-PS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkht%2FDHCPClient-PS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkht%2FDHCPClient-PS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkht","download_url":"https://codeload.github.com/mkht/DHCPClient-PS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkht%2FDHCPClient-PS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284734143,"owners_count":27054623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-16T02:00:05.974Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T01:18:39.264Z","updated_at":"2026-01-02T20:28:18.144Z","avatar_url":"https://github.com/mkht.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DHCPClient-PS\r\n\r\n## Description\r\nPowerShell DHCP Client module for testing purpose.  \r\nThis module can broadcast DHCP discover, inform, request, and release packets with arbitrary parameters, and receive responses from servers. You can test the health of DHCP servers or check for the presence of multiple DHCP servers in a subnet.\r\n\r\n## Install\r\nYou can install the module from [PowerShell Gallery](https://www.powershellgallery.com/packages/DHCPClient-PS).\r\n\r\n```PowerShell\r\nInstall-Module -Name DHCPClient-PS\r\n```\r\n\r\n## Platforms\r\n+ Windows PowerShell 5.1\r\n+ PowerShell 7.0 and above (Windows, macOS and Linux)\r\n\r\n## Usage\r\n\r\n- [Invoke-DhcpDiscover](#Invoke-DhcpDiscover)\r\n- [Invoke-DhcpInform](#Invoke-DhcpInform)\r\n- [Invoke-DhcpRequest](#Invoke-DhcpRequest)\r\n- [Invoke-DhcpRelease](#Invoke-DhcpRelease)\r\n- [Test-DhcpClient](#Test-DhcpClient)\r\n- [Invoke-DhcpCustomMessage](#Invoke-DhcpCustomMessage)\r\n- [New-DhcpPacket](#New-DhcpPacket)\r\n- [About DhcpPacket class](#About-DhcpPacket-class)\r\n\r\n----\r\n### Invoke-DhcpDiscover\r\nSend DHCP Discover message, then receive Offer messages from DHCP server(s).\r\n\r\n#### Examples\r\nWhen you run this function without any parameters, it sends a message with the default MAC address (`AA-BB-CC-DD-EE-FF`) and receive a fastest offer response.\r\n\r\n```PowerShell\r\nPS\u003e $Response = Invoke-DhcpDiscover -MacAddress AABBCCDDEEFF -BroadcastFlag $true\r\nPS\u003e $Response | Select-Object MessageType, YIAddr, SIAddr, CHAddr, Options\r\n\r\nMessageType : DHCPOFFER\r\nYIAddr      : 192.168.0.4\r\nSIAddr      : 192.168.0.1\r\nCHAddr      : AABBCCDDEEFF\r\nOptions     : {@{OptionCode=1; Name=SubnetMask; Value=255.255.255.0; Length=4}...}\r\n```\r\n\r\n#### Parameters\r\n\r\n* **`-MacAddress`**  [string]  \r\nSpecifies MAC address for the request.  \r\nDefault: `AA-BB-CC-DD-EE-FF`\r\n\r\n* **`-RequestIPAddress`**  [IPAddress]  \r\nSpecifies IP address that the client requests to be assigned.  \r\nThis is corresponding to DHCP [option 50](https://tools.ietf.org/html/rfc2132#section-9.1).\r\n\r\n* **`-TransactionId`**  [byte[]]  \r\nSpecifies the Transaction ID value.  \r\nThe value should be 4-bytes array.  \r\nDefault: a random number\r\n\r\n* **`-VendorClassId`**  [string]  \r\nSpecifies the vendor-class-identifier value.  \r\nThis is corresponding to DHCP [option 60](https://tools.ietf.org/html/rfc2132#section-9.13).  \r\nDefault: not set\r\n\r\n* **`-ClientId`**  [byte[]]  \r\nSpecifies the client-identifier value.  \r\nThis is corresponding to DHCP [option 61](https://tools.ietf.org/html/rfc2132#section-9.14).  \r\nDefault: The value of MAC address.\r\n\r\n\u003e [!NOTE]\r\n\u003e When specifying the ClientId parameter, should include the type byte at the beginning of the value.  \r\n\u003e For example, if the client identifier type is Ethernet (type 0x01), and the MAC address is `AA-BB-CC-DD-EE-FF`, you should set the ClientId parameter to `(0x01, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF)`.\r\n\r\n* **`-ParameterRequestList`**  [byte[]]  \r\nSpecifies request values for configuration parameters.  \r\nThis is corresponding to DHCP [option 55](https://tools.ietf.org/html/rfc2132#section-9.8).  \r\nDefault: `1, 3, 4, 15, 31, 33, 42, 119, 252`\r\n\r\n* **`-BroadcastFlag`**  [bool]  \r\nSpecifies the flag to request the server to broadcast a reply.  \r\nDefault: `False`\r\n\r\n* **`-Timeout`**  [byte]  \r\nSpecifies how long seconds to wait until a response is received.  \r\nDefault: 10\r\n\r\n* **`-LongPoll`**  [switch]  \r\nBy default, only the first response received will output. If this switch is specified, it will wait until the timeout period and output all responses received. This is useful to check whether there are multiple DHCP servers in a subnet.\r\n\r\n* **`-NoXidFilter`**  [switch]  \r\nBy default, when the transaction ID of a received packet does not match the ID of an sent packet, it is discarded. If this switch is specified, packets whose IDs do not match will also be output.\r\n\r\n#### Outputs\r\n[DhcpPacket](#About-DhcpPacket-class) object\r\n\r\n----\r\n### Invoke-DhcpInform\r\nSend DHCP Inform message, then receive ACK messages from DHCP server(s).  \r\n\r\n#### Examples\r\n```PowerShell\r\nPS\u003e $CurrentIP = (Get-NetIPAddress -AddressFamily IPv4 -InterfaceIndex 15).IPAddress\r\nPS\u003e $Response =  Invoke-DhcpInform -ClientIPAddress $CurrentIP -ServerIPAddress '192.168.0.1' -MacAddress 'ABCDEF012345'\r\nPS\u003e $Response | Select-Object MessageType, CIAddr, CHAddr, Options\r\n\r\nMessageType : DHCPACK\r\nCIAddr      : 192.168.0.8\r\nSIAddr      : 192.168.0.1\r\nCHAddr      : ABCDEF012345\r\nOptions     : {@{OptionCode=1; Name=SubnetMask; Value=255.255.255.0; Length=4}...}\r\n```\r\n\r\n#### Parameters\r\n\r\n* **`-MacAddress`**  [string]  \r\nSpecifies MAC address for the request.  \r\nDefault: `AA-BB-CC-DD-EE-FF`\r\n\r\n* **`-ClientIPAddress`**  [IPAddress]  \r\nSpecifies Client IP address.  \r\nThis is mandatory parameter.\r\n\r\n* **`-ServerIPAddress`**  [IPAddress]  \r\nSpecifies DHCP server address.  \r\nDefault: `0.0.0.0` (Any)\r\n\r\n* **`-TransactionId`**  [byte[]]  \r\nSpecifies the Transaction ID value.  \r\nThe value should be 4-bytes array.  \r\nDefault: a random number\r\n\r\n* **`-VendorClassId`**  [string]  \r\nSpecifies the vendor-class-identifier value.  \r\nThis is corresponding to DHCP [option 60](https://tools.ietf.org/html/rfc2132#section-9.13).  \r\nDefault: not set\r\n\r\n* **`-ClientId`**  [byte[]]  \r\nSpecifies the client-identifier value.  \r\nThis is corresponding to DHCP [option 61](https://tools.ietf.org/html/rfc2132#section-9.14).  \r\nDefault: The value of MAC address.\r\n\r\n* **`-ParameterRequestList`**  [byte[]]  \r\nSpecifies request values for configuration parameters.  \r\nThis is corresponding to DHCP [option 55](https://tools.ietf.org/html/rfc2132#section-9.8).  \r\nDefault: `1, 3, 4, 15, 31, 33, 42, 119, 252`\r\n\r\n* **`-BroadcastFlag`**  [bool]  \r\nSpecifies the flag to request the server to broadcast a reply.  \r\nDefault: `False`\r\n\r\n* **`-Timeout`**  [byte]  \r\nSpecifies how long seconds to wait until a response is received.  \r\nDefault: 10\r\n\r\n* **`-LongPoll`**  [switch]  \r\nBy default, only the first response received will output. If this switch is specified, it will wait until the timeout period and output all responses received. This is useful to check whether there are multiple DHCP servers in a subnet.\r\n\r\n* **`-NoXidFilter`**  [switch]  \r\nBy default, when the transaction ID of a received packet does not match the ID of an sent packet, it is discarded. If this switch is specified, packets whose IDs do not match will also be output.\r\n\r\n#### Outputs\r\n[DhcpPacket](#About-DhcpPacket-class) object\r\n\r\n----\r\n### Invoke-DhcpRequest\r\nSend DHCP Request message, then receive ACK messages from DHCP server.\r\n\r\n#### Examples\r\n```PowerShell\r\nPS\u003e $Response = Invoke-DhcpRequest -MacAddress AABBCCDDEEFF -RequestIPAddress 192.168.0.4 -ServerIPAddress 192.168.0.1\r\nPS\u003e $Response | Select-Object MessageType, YIAddr, SIAddr, CHAddr, Options\r\n\r\nMessageType : DHCPACK\r\nYIAddr      : 192.168.0.4\r\nSIAddr      : 0.0.0.0\r\nCHAddr      : AABBCCDDEEFF\r\nOptions     : {@{OptionCode=1; Name=SubnetMask; Value=255.255.255.0; Length=4}...}\r\n```\r\n\r\nYou can also input DHCP Offer packet object from pipeline.\r\n```PowerShell\r\nPS\u003e Invoke-DhcpDiscover | Invoke-DhcpRequest\r\n```\r\n\r\n#### Parameters\r\n\r\n* **`-MacAddress`**  [string]  \r\nSpecifies MAC address for the request.  \r\nThis is mandatory parameter.\r\n\r\n* **`-RequestIPAddress`**  [IPAddress]  \r\nSpecifies IP address that the client requests to be assigned.  \r\nThis is corresponding to DHCP [option 50](https://tools.ietf.org/html/rfc2132#section-9.1).  \r\nThis is mandatory parameter.\r\n\r\n* **`-ServerIPAddress`**  [IPAddress]  \r\nSpecifies DHCP server address.  \r\nThis is corresponding to DHCP [option 54](https://tools.ietf.org/html/rfc2132#section-9.7).  \r\nThis is mandatory parameter.\r\n\r\n* **`-TransactionId`**  [byte[]]  \r\nSpecifies the Transaction ID value.  \r\nThe value should be 4-bytes array.  \r\nDefault: a random number\r\n\r\n* **`-VendorClassId`**  [string]  \r\nSpecifies the vendor-class-identifier value.  \r\nThis is corresponding to DHCP [option 60](https://tools.ietf.org/html/rfc2132#section-9.13).  \r\nDefault: not set\r\n\r\n* **`-ClientId`**  [byte[]]  \r\nSpecifies the client-identifier value.  \r\nThis is corresponding to DHCP [option 61](https://tools.ietf.org/html/rfc2132#section-9.14).  \r\nDefault: The value of MAC address.\r\n\r\n* **`-ParameterRequestList`**  [byte[]]  \r\nSpecifies request values for configuration parameters.  \r\nThis is corresponding to DHCP [option 55](https://tools.ietf.org/html/rfc2132#section-9.8).  \r\nDefault: `1, 3, 4, 15, 31, 33, 42, 119, 252`\r\n\r\n* **`-BroadcastFlag`**  [bool]  \r\nSpecifies the flag to request the server to broadcast a reply.  \r\nDefault: `False`\r\n\r\n* **`-Timeout`**  [byte]  \r\nSpecifies how long seconds to wait until a response is received.  \r\nDefault: 10\r\n\r\n* **`-LongPoll`**  [switch]  \r\nBy default, only the first response received will output. If this switch is specified, it will wait until the timeout period and output all responses received. This is useful to check whether there are multiple DHCP servers in a subnet.\r\n\r\n* **`-NoXidFilter`**  [switch]  \r\nBy default, when the transaction ID of a received packet does not match the ID of an sent packet, it is discarded. If this switch is specified, packets whose IDs do not match will also be output.\r\n\r\n#### Outputs\r\n[DhcpPacket](#About-DhcpPacket-class) object\r\n\r\n----\r\n### Invoke-DhcpRelease\r\nSend DHCP Release message.\r\n\r\n#### Examples\r\n```PowerShell\r\nPS\u003e Invoke-DhcpRelease -MacAddress AABBCCDDEEFF -ClientIPAddress 192.168.0.4 -ServerIPAddress 192.168.0.1\r\n```\r\n\r\nYou can also input DHCP Ack packet object from pipeline.\r\n```PowerShell\r\nPS\u003e $AckResponse = Invoke-DHCPDiscover | Invoke-DHCPRequest\r\nPS\u003e $AckResponse | Invoke-DhcpRelease\r\n```\r\n\r\n#### Parameters\r\n\r\n* **`-MacAddress`**  [string]  \r\nSpecifies MAC address for the request.  \r\nThis is mandatory parameter.\r\n\r\n* **`-ClientIPAddress`**  [IPAddress]  \r\nSpecifies IP address that the client requests to be released.  \r\nThis is mandatory parameter.\r\n\r\n* **`-ServerIPAddress`**  [IPAddress]  \r\nSpecifies DHCP server address.  \r\nThis is mandatory parameter.\r\n\r\n* **`-TransactionId`**  [byte[]]  \r\nSpecifies the Transaction ID value.  \r\nThe value should be 4-bytes array.  \r\nDefault: a random number\r\n\r\n* **`-ClientId`**  [byte[]]  \r\nSpecifies the client-identifier value.  \r\nThis is corresponding to DHCP [option 61](https://tools.ietf.org/html/rfc2132#section-9.14).  \r\nDefault: The value of MAC address.\r\n\r\n#### Outputs\r\nThis function does not output anything.\r\n\r\n----\r\n### Test-DhcpClient\r\nPerform a full DHCP client process: Discover =\u003e Request =\u003e Release\r\n\r\n#### Examples\r\n```PowerShell\r\nPS\u003e $Result = Test-DhcpClient -MacAddress AABBCCDDEEFF\r\nDHCP Discover sent          : Client MAC  = AABBCCDDEEFF\r\nDHCP Offer received         : Offered IP  = 192.168.10.2, Server IP = 192.168.10.1\r\nDHCP Request sent           : Request IP  = 192.168.10.2, Server IP = 192.168.10.1\r\nDHCP Ack received           : Assigned IP = 192.168.10.2, Server IP = 0.0.0.0\r\nDHCP Release sent           : Client IP   = 192.168.10.2, Server IP = 0.0.0.0\r\n\r\nPS\u003e $Result\r\nTrue\r\n```\r\n\r\n#### Parameters\r\n\r\n* **`-MacAddress`**  [string]  \r\nSpecifies MAC address for the request.  \r\nDefault: `AA-BB-CC-DD-EE-FF`\r\n\r\n* **`-RequestIPAddress`**  [IPAddress]  \r\nSpecifies IP address that the client requests to be assigned.  \r\nThis is corresponding to DHCP [option 50](https://tools.ietf.org/html/rfc2132#section-9.1).\r\n\r\n* **`-TransactionId`**  [byte[]]  \r\nSpecifies the Transaction ID value.  \r\nThe value should be 4-bytes array.  \r\nDefault: a random number\r\n\r\n* **`-VendorClassId`**  [string]  \r\nSpecifies the vendor-class-identifier value.  \r\nThis is corresponding to DHCP [option 60](https://tools.ietf.org/html/rfc2132#section-9.13).  \r\nDefault: not set\r\n\r\n* **`-ClientId`**  [byte[]]  \r\nSpecifies the client-identifier value.  \r\nThis is corresponding to DHCP [option 61](https://tools.ietf.org/html/rfc2132#section-9.14).  \r\nDefault: The value of MAC address.\r\n\r\n* **`-ParameterRequestList`**  [byte[]]  \r\nSpecifies request values for configuration parameters.  \r\nThis is corresponding to DHCP [option 55](https://tools.ietf.org/html/rfc2132#section-9.8).  \r\nDefault: `1, 3, 4, 15, 31, 33, 42, 119, 252`\r\n\r\n* **`-BroadcastFlag`**  [bool]  \r\nSpecifies the flag to request the server to broadcast a reply.  \r\nDefault: `False`\r\n\r\n* **`-Timeout`**  [byte]  \r\nSpecifies how long seconds to wait until a response is received.  \r\nDefault: 10\r\n\r\n* **`-NoXidFilter`**  [switch]  \r\nBy default, when the transaction ID of a received packet does not match the ID of an sent packet, it is discarded. If this switch is specified, packets whose IDs do not match will also be output.\r\n\r\n* **`-ReleaseAfterTest`**  [switch]  \r\nIf this switch is specified, a DHCP Release message will be sent after receiving the DHCP Ack.\r\nDefault: `False`\r\n\r\n#### Outputs\r\nThis function returns `True` if the DHCP client process is completed successfully.  \r\n\r\n----\r\n### Invoke-DhcpCustomMessage\r\nSend any DHCP message. This can be used when you need to specify detailed DHCP options, but requires knowledge of DHCP messages.\r\n\r\n#### Examples\r\n```PowerShell\r\nPS\u003e $Options = [ordered]@{\r\n        12 = 'HOSTNAME'\r\n        50 = [IPAddress]'192.168.0.10'\r\n        55 = [byte[]](1,3,6,15,31,33,43,44)\r\n        60 = 'MSFT 5.0'\r\n        119 = ('foo.example.com', 'example.com')\r\n    }\r\nPS\u003e $Message = New-DhcpPacket -Type DHCPDISCOVER -TransactionId (0,1,2,3) -MacAddress 1A2B3C4D5E6F -ServerIPAddress 192.168.0.1 -Options $Options\r\nPS\u003e $Response = $Message | Invoke-DhcpCustomMessage\r\n```\r\n\r\n#### Parameters\r\n\r\n* **`-DhcpPacket`**  [[DhcpPacket](#About-DhcpPacket-class)]  \r\nSpecifies DHCP packet object that is created by `New-DhcpPacket`.  \r\nThis is mandatory parameter.\r\n\r\n* **`-ServerIPAddress`**  [IPAddress]  \r\nSpecifies IP address to the message will be sent.  \r\nDefault: `255.255.255.255` (Broadcast address)\r\n\r\n* **`-Timeout`**  [byte]  \r\nSpecifies how long seconds to wait until a response is received.  \r\nDefault: 10\r\n\r\n* **`-LongPoll`**  [switch]  \r\nBy default, only the first response received will output. If this switch is specified, it will wait until the timeout period and output all responses received. This is useful to check whether there are multiple DHCP servers in a subnet.\r\n\r\n* **`-NoXidFilter`**  [switch]  \r\nBy default, when the transaction ID of a received packet does not match the ID of an sent packet, it is discarded. If this switch is specified, packets whose IDs do not match will also be output.\r\n\r\n* **`-NoReceive`**  [switch]  \r\nIf this switch is specified, this function will only send a message and not trying to receive any response.\r\n\r\n#### Outputs\r\n[DhcpPacket](#About-DhcpPacket-class) object\r\n\r\n----\r\n### New-DhcpPacket\r\nCreate [DhcpPacket](#About-DhcpPacket-class) object.\r\n\r\n#### Examples\r\n```PowerShell\r\nPS\u003e $Options = @{\r\n        12 = 'HOSTNAME'\r\n        50 = [IPAddress]'192.168.0.10'\r\n        55 = [byte[]](1,3,6,15,31,33,43,44)\r\n        60 = 'MSFT 5.0'\r\n        119 = ('foo.example.com', 'example.com')\r\n    }\r\nPS\u003e $Message = New-DhcpPacket -Type DHCPDISCOVER -TransactionId (0,1,2,3) -MacAddress 1A2B3C4D5E6F -ServerIPAddress 192.168.0.1 -Options $Options\r\nPS\u003e $Message | Select-Object MessageType, XID, CHAddr, Options\r\n\r\nMessageType : DHCPDISCOVER\r\nXID         : {0, 1, 2, 3}\r\nCHAddr      : 1A2B3C4D5E6F\r\nOptions     : {53, 61, 54, 55…}\r\n\r\nPS\u003e $Message.Options\r\n\r\nName                           Value\r\n----                           -----\r\n53                             DHCPMessageType (DHCPDISCOVER)\r\n61                             ClientId (1 26 43 60 77 94 111)\r\n54                             ServerId (192.168.0.1)\r\n55                             ParameterRequestList (1 3 6 15 31 33 43 44)\r\n12                             Hostname (HOSTNAME)\r\n60                             ClassId (MSFT 5.0)\r\n50                             RequestedIPAddress (192.168.0.10)\r\n119                            DomainSearch (foo.example.com example.com)\r\n255                            End ()\r\n```\r\n\r\n#### Parameters\r\n\r\n* **`-Type`**  [string]  \r\nSpecifies DHCP message type.  \r\nYou can select from `DHCPDISCOVER`, `DHCPOFFER`, `DHCPREQUEST`, `DHCPDECLINE`, `DHCPACK`, `DHCPNAK`, `DHCPRELEASE`, `DHCPINFORM`, `DHCPFORCERENEW`  \r\nThis is mandatory parameter.\r\n\r\n* **`-TransactionId`**  [byte[]]  \r\nSpecifies transaction ID (xid) as 4-length byte array.  \r\nIf does not specified, random number will set.\r\n\r\n* **`-MacAddress`**  [string]  \r\nSpecifies MAC address for the request.  \r\nDefault: `AA-BB-CC-DD-EE-FF`\r\n\r\n* **`-ServerIPAddress`**  [IPAddress]  \r\nSpecifies DHCP server address.  \r\nDefault: `0.0.0.0` (Any address)\r\n\r\n* **`-VendorClassId`**  [string]  \r\nSpecifies the vendor-class-identifier value.  \r\nThis is corresponding to DHCP [option 60](https://tools.ietf.org/html/rfc2132#section-9.13).  \r\nDefault: not set\r\n\r\n* **`-ClientId`**  [byte[]]  \r\nSpecifies the client-identifier value.  \r\nThis is corresponding to DHCP [option 61](https://tools.ietf.org/html/rfc2132#section-9.14).  \r\nDefault: The value of MAC address.\r\n\r\n* **`-ParameterRequestList`**  [byte[]]  \r\nSpecifies request values for configuration parameters.  \r\nThis is corresponding to DHCP [option 55](https://tools.ietf.org/html/rfc2132#section-9.8).\r\n\r\n* **`-Options`**  [IDictionary]  \r\nSpecifies DHCP configuration option parameters.  \r\nYou should specify the param as hashtable or dictionary that the key as option number and value as bytes. (See example)\r\n\r\n* **`-BroadcastFlag`**  [bool]  \r\nSpecifies the flag to request the server to broadcast a reply.  \r\nDefault: `False`\r\n\r\n\r\n#### Outputs\r\n[DhcpPacket](#About-DhcpPacket-class) object\r\n\r\n----\r\n### About DhcpPacket class\r\n\r\n`[DhcpPacket]` is representation class for DHCP packet.\r\n\r\n#### Constructor\r\nThis class is not published as public. You should create instance by `New-DhcpPacket` function.\r\n\r\n#### Members\r\nMost of the members correspond to the structure of a DHCP packet. See [RFC 2131](https://tools.ietf.org/html/rfc2131) for details.\r\n\r\n| Name          | Type              | Description                                                                |\r\n| :------------ | :---------------- | :------------------------------------------------------------------------- |\r\n| OpCode        | [byte]            | Message op code                                                            |\r\n| HType         | [byte]            | Hardware address type                                                      |\r\n| HLen          | [byte]            | Hardware address type                                                      |\r\n| Hops          | [byte]            | Normally client sets to zero.                                              |\r\n| XID           | [byte[]]          | Transaction ID                                                             |\r\n| Secs          | [Uint16]          | Seconds elapsed since client began address acquisition or renewal process. |\r\n| Flags         | [Uint16]          | Flags                                                                      |\r\n| CIAddr        | [ipaddress]       | Client IP address                                                          |\r\n| YIAddr        | [ipaddress]       | 'your' (client) IP address                                                 |\r\n| SIAddr        | [ipaddress]       | IP address of next server to use in bootstrap.                             |\r\n| GIAddr        | [ipaddress]       | Relay agent IP address                                                     |\r\n| CHAddr        | [PhysicalAddress] | Client hardware address                                                    |\r\n| SName         | [string]          | Optional server host name                                                  |\r\n| File          | [string]          | Boot file name                                                             |\r\n| MagicCookie   | [byte[]]          | Magic cookie, Should be `0x63, 0x82, 0x53, 0x63`                           |\r\n| MessageType   | [byte]            | DHCP Message type                                                          |\r\n| Options       | [Dictionary]      | DHCP Configuration Options (Read-only).                                    |\r\n| BroadcastFlag | [bool]            | Flag to request a broadcast response from the server.                      |\r\n\r\n#### Methods\r\n| Name                        | Return type | Description                                                                |\r\n| :-------------------------- | :---------- | :------------------------------------------------------------------------- |\r\n| AddDhcpOption(byte, byte[]) | [void]      | Add DHCP Option. 1st parameter is an option number, 2nd is value of bytes. |\r\n| RemoveDhcpOption(byte)      | [bool]      | Remove DHCP Option. parameter is an option number.                         |\r\n| GetPacketBytes()            | [byte[]]    | Returns raw bytes packet.                                                  |\r\n\r\n\r\n## Change log\r\n+ **2.3.0**\r\n  - Remove `-VendorClassId` parameter from `Invoke-DhcpRelease`. It was not compliant with RFCs.\r\n  - Add `Test-DhcpClient` function that performs a full DHCP client process (Discover =\u003e Request =\u003e Release).\r\n  - Fix minor issues.\r\n\r\n+ **2.2.0**\r\n  - Add `-VendorClassId` parameter.\r\n  - Fix minor issues.\r\n\r\n+ **2.1.0**\r\n  - Add `-TransactionId` parameter.\r\n  - Changed to discard received packets that do not match the transaction ID. If you want to receive all packets, use the new `-NoXidFilter` switch parameter.\r\n\r\n+ **2.0.1**\r\n  - Fix minor issue.\r\n\r\n+ **2.0.0**\r\n  - The order of DHCP options is now preserved. Previously, they were sorted.\r\n  - Add support for parsing Domain Search List (Option 119, defined in [RFC 3397](https://tools.ietf.org/html/rfc3397))\r\n  - Add support for parsing time offset (Option 2)\r\n  - Add support for handling DHCP option values that are longer than 255 bytes. (Encoding Long Options as defined in [RFC 3396](https://tools.ietf.org/html/rfc3396))\r\n  - Add `RemoveDhcpOption()` method to `[DhcpPacket]` class.\r\n  - Fix an issue that the `-Options` parameter of `New-DhcpPacket` does not allow adding options that are not defined in IANA.\r\n  - Miscellaneous improvements and bug fixes.\r\n\r\n+ **1.1.3**\r\n  - Fixed: The number of seconds larger than the `[Int32]::MaxValue` is not parsed correctly.\r\n\r\n+ **1.1.2**\r\n  - Fixed: `Invoke-DhcpInform` with pipeline input does not function.\r\n\r\n+ **1.1.0**\r\n  - Add `Invoke-DhcpInform` function\r\n  - Allow the broadcast flag to be specified. (`-BroadcastFlag` parameter)\r\n\r\n+ **1.0.0**\r\n  - First public release\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkht%2Fdhcpclient-ps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkht%2Fdhcpclient-ps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkht%2Fdhcpclient-ps/lists"}