NetworkScript/test-syntax.ps1
Maddo d006870d96 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.
2026-03-17 13:18:08 +01:00

12 lines
517 B
PowerShell

$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
}
}