Skip to content

Complete the documentation information #3632

Open
@lorenzosoncini

Description

@lorenzosoncini

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=$.name + " = " + $dnstypes[$.type] + " = " + $dnsStatus[$_.status]
$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.

Metadata

Metadata

Assignees

Labels

area-dnsclientIssues for dnsclient moduledoc-bugFor Upwork freelance team categories/reporting.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions