Description
String Values are being converted or displayed as integers when piped to Select. How can this be overcome to keep the values outputted as strings.
Get-DnsClientCache | Select-Object -First 5
Entry | RecordName | Record Type | Status | Section | TimeToLive | DataLength | Data |
---|---|---|---|---|---|---|---|
av-srv.test.local | nav-srv.test.local | A | Success | Answer | 411237 | 4 | 127.0.0.1 |
nav-srv.test.local | AAAA | NoRecords | |||||
businesscentral.v… | businesscentral.v… | A | Success | Answer | 518 | 4 | |
a751973eac2731385.awsglo… | a751973eac2731385.awsglo… | A | Success | Answer | 218 | 4 | 75.2.68.222 |
a751973eac2731385.awsglo… | a751973eac2731385.awsglo… | A | Success | Answer | 218 | 4 | 99.83.252.222 |
Get-DnsClientCache | Select-Object Name,Type,Status -First 5
Name | Type | Status |
---|---|---|
28 | 9501 | |
nav-srv.test.local | 1 | 0 |
businesscentral.v.... | 1 | 0 |
a751973eac2731385.awsglobalaccelerator.com | 1 | 0 |
a751973eac2731385.awsglobalaccelerator.com | 1 | 0 |
Complete the documentation with the traslation from Type in into Record Type
Hash table of Types
$dnstypes = @{
[uint16]1 = "A"
[uint16]2 = "NS"
[uint16]5 = "CNAME"
[uint16]6 = "SOA"
[uint16]12 = "PTR"
[uint16]15 = "MX"
[uint16]28 = "AAA"
[uint16]33 = "SRV"
}
via https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/hh872334(v=vs.85)
Hash table of Status
$dnsStatus = @{
[uint32]0 = "Success"
[uint32]9003 = "NotExist"
[uint32]9701 = "NoRecords"
}
get-dnsclientcache | select name,type, status | ForEach-object {
$out
}
Some of the previous information are found in internet from
https://ss64.org/viewtopic.php?t=501
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 763d4e56-75f2-f5e1-71dc-02d4b18915f1
- Version Independent ID: af314c4c-3643-5b84-8543-520843bbf2fb
- Content: Get-DnsClientCache (DnsClient)
- Content Source: docset/winserver2022-ps/dnsclient/Get-DnsClientCache.md
- Product: w10
- GitHub Login: @JasonGerend
- Microsoft Alias: jgerend