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:
parent
905789c3ad
commit
d006870d96
5 changed files with 842 additions and 461 deletions
12
test-syntax.ps1
Normal file
12
test-syntax.ps1
Normal 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
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue