Remove obsolete PowerShell script for generating Visual Studio projects and add a new script for testing PowerShell syntax. The new script verifies basic constructs used in build scripts, ensuring proper syntax and functionality.
This commit is contained in:
31
scripts/test-powershell-syntax.ps1
Normal file
31
scripts/test-powershell-syntax.ps1
Normal file
@@ -0,0 +1,31 @@
|
||||
# Simple test script to verify PowerShell syntax
|
||||
# This script tests basic PowerShell constructs used in our build scripts
|
||||
|
||||
Write-Host "Testing PowerShell syntax..." -ForegroundColor Green
|
||||
|
||||
# Test try-catch blocks
|
||||
try {
|
||||
Write-Host "✓ Try-catch syntax works" -ForegroundColor Green
|
||||
} catch {
|
||||
Write-Host "✗ Try-catch syntax failed" -ForegroundColor Red
|
||||
}
|
||||
|
||||
# Test if-else blocks
|
||||
if ($true) {
|
||||
Write-Host "✓ If-else syntax works" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "✗ If-else syntax failed" -ForegroundColor Red
|
||||
}
|
||||
|
||||
# Test parameter blocks
|
||||
param(
|
||||
[switch]$TestParam = $false
|
||||
)
|
||||
|
||||
Write-Host "✓ Parameter syntax works" -ForegroundColor Green
|
||||
|
||||
# Test string interpolation
|
||||
$testVar = "PowerShell"
|
||||
Write-Host "✓ String interpolation works: $testVar" -ForegroundColor Green
|
||||
|
||||
Write-Host "All syntax tests passed!" -ForegroundColor Green
|
||||
Reference in New Issue
Block a user