Add comprehensive GitHub Copilot instructions for PSModule/Dns repository #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a comprehensive
.github/copilot-instructions.md
file that provides GitHub Copilot coding agents with detailed instructions for working effectively in the PSModule/Dns repository.What's Included
The instructions provide exhaustively validated commands and workflows covering:
Key Features
Exhaustive Validation: Every single command was tested and timed to ensure reliability. The instructions include specific timeout recommendations (30+ seconds minimum) with "NEVER CANCEL" warnings for all operations.
Network-Aware: Documents that external DNS resolution fails in sandbox environments but works in CI, with specific workarounds using localhost/127.0.0.1 for local testing.
Framework-Specific: Explains how this PowerShell module uses the PSModule framework for building, testing, and publishing - requiring no traditional build compilation.
Practical Validation: Includes three manual validation scenarios that agents can run to verify their changes work correctly:
The instructions follow an imperative tone ("Run this command", "Do not do that") and start with a firm directive to reference these instructions first before falling back to additional search or context gathering.
Fixes #6.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
example.com
. ./src/classes/public/DnsHost.ps1
. ./src/functions/public/Resolve-DnsHost.ps1
Define LogGroup function for tests
function LogGroup {
param(
[string]$Title,
[scriptblock]$ScriptBlock
)
Write-Host "::group::$Title"
try {
& $ScriptBlock
} finally {
Write-Host '::endgroup::'
}
}
Invoke-Pester ./tests/Dns.Tests.ps1 -Passthru` (dns block)
Define LogGroup function required by tests
function LogGroup {
param([string]$Title, [scriptblock]$ScriptBlock)
Write-Host "::group::$Title"
try { & $ScriptBlock } finally { Write-Host '::endgroup::' }
}
Load module first
. ./src/classes/public/DnsHost.ps1
. ./src/functions/public/Resolve-DnsHost.ps1
Run Pester tests
Invoke-Pester ./tests/Dns.Tests.ps1 -Passthru | Out-Null
Write-Host 'Tests completed - external DNS failures expected in sandbox'` (dns block)
Define LogGroup function for tests
function LogGroup {
param(
[string]$Title,
[scriptblock]$ScriptBlock
)
Write-Host "::group::$Title"
try {
& $ScriptBlock
} finally {
Write-Host '::endgroup::'
}
}
Invoke-Pester ./tests/Dns.Tests.ps1 -Passthru` (dns block)
Define LogGroup function required by tests
function LogGroup {
param([string]$Title, [scriptblock]$ScriptBlock)
Write-Host "::group::$Title"
try { & $ScriptBlock } finally { Write-Host '::endgroup::' }
}
Load module first
. ./src/classes/public/DnsHost.ps1
. ./src/functions/public/Resolve-DnsHost.ps1
Run Pester tests
Invoke-Pester ./tests/Dns.Tests.ps1 -Passthru | Out-Null
Write-Host 'Tests completed - external DNS failures expected in sandbox'` (dns block)
Write-Host 'Manual validation of Dns module functionality:'
Write-Host ''
Write-Host '1. Testing DnsHost class construction:'
$dnsHost = [DnsHost]::new('test.example.com', 'test', @('192.168.1.1', '192.168.1.2'))
$dnsHost | Format-List
Write-Host '2. Testing Resolve-DnsHost with localhost:'
$result = Resolve-DnsHost -Name '127.0.0.1'
if ($result) {
Write-Host 'SUCCESS: DNS resolution works!'
$result | Format-List
} else {
Write-Host 'FAILED: DNS resolution returned null'
}
Write-Host '3. Testing Resolve-DnsHost with invalid host:'
$result = Resolve-DnsHost -Name 'nonexistent.invalid.domain.test'
if ($result) {
Write-Host 'UNEXPECTED: Should have returned null'
$result | Format-List
} else {
Write-Host 'SUCCESS: Invalid domain correctly returned null'
}` (dns block)
Load the module
. ./src/classes/public/DnsHost.ps1
. ./src/functions/public/Resolve-DnsHost.ps1
Write-Host 'Test 1: DnsHost class construction'
$dnsHost = [DnsHost]::new('test.example.com', 'test', @('192.168.1.1', '192.168.1.2'))
$dnsHost | Format-List
Write-Host 'Test 2: DNS resolution with localhost (WORKS in sandbox)'
$result = Resolve-DnsHost -Name '127.0.0.1'
if ($result) {
Write-Host 'SUCCESS: DNS resolution works!'
$result | Format-List
} else {
Write-Host 'FAILED: DNS resolution returned null'
}
Write-Host 'Test 3: Invalid domain handling'
$result = Resolve-DnsHost -Name 'nonexistent.invalid.domain.test'
if ($result) {
Write-Host 'UNEXPECTED: Should have returned null'
} else {
Write-Host 'SUCCESS: Invalid domain correctly returned null'
}` (dns block)
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.