Add Network Adapter Configuration Tool and Presets Management

- Created NetworkAdapter.psm1 module for managing network adapters.
- Implemented functions for displaying adapter information, setting DHCP/manual configurations, and managing DNS settings.
- Added functionality to save and load network presets in JSON format.
- Introduced a schema for validating the presets structure.
- Added a .gitignore file to exclude local network presets from version control.
- Created a test-syntax.ps1 script to validate PowerShell syntax for the main script files.
This commit is contained in:
Maddo 2026-03-17 13:18:08 +01:00
commit d006870d96
5 changed files with 842 additions and 461 deletions

12
test-syntax.ps1 Normal file
View file

@ -0,0 +1,12 @@
$files = @('NetworkAdapter.psm1','Set-NetworkAdapter.ps1')
foreach ($f in $files) {
Write-Host '---' $f '---'
$errors = $null
[void][System.Management.Automation.Language.Parser]::ParseFile((Join-Path $PSScriptRoot $f), [ref]$null, [ref]$errors)
if ($errors -and $errors.Count -gt 0) {
$errors | ForEach-Object { Write-Host ("Line {0}: {1}" -f $_.Extent.StartLineNumber, $_.Message) -ForegroundColor Red }
}
else {
Write-Host 'No syntax errors.' -ForegroundColor Green
}
}