changed: logging
changed: sort and deduplicate output changed: "GruppenVerwaltungNEU..." output
This commit is contained in:
parent
b84b5a73a1
commit
a5e28a7f52
12 changed files with 785 additions and 1280 deletions
20
Test-ScriptSyntax.ps1
Normal file
20
Test-ScriptSyntax.ps1
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Test-ScriptSyntax.ps1 - parses all .ps1 files without executing them
|
||||
param([string] $Path = ".")
|
||||
|
||||
Get-ChildItem -Path $Path -Filter *.ps1 | ForEach-Object {
|
||||
$tokens = $null
|
||||
$errors = $null
|
||||
[System.Management.Automation.Language.Parser]::ParseFile(
|
||||
$_.FullName, [ref]$tokens, [ref]$errors) | Out-Null
|
||||
if ($errors.Count -gt 0)
|
||||
{
|
||||
Write-Output "FAIL: $($_.Name) ($($errors.Count) Fehler)"
|
||||
$errors | ForEach-Object {
|
||||
Write-Output (" Zeile {0}: {1}" -f $_.Extent.StartLineNumber, $_.Message)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Output "OK: $($_.Name)"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue