migrate AI engineering suite #6

Merged
pierpaolo.mammi merged 5 commits from feature/migrate-ai-engineering-suite into main 2026-10-13 10:18:29 +02:00
2 changed files with 52 additions and 8 deletions
Showing only changes of commit 99ec3384d3 - Show all commits

No files matched your search

+4 -8
View File
@@ -1,18 +1,14 @@
function Initialize-PowerShellEnvironment { function Import-PowerShellYamlModule {
Write-Host "Initializing PowerShell environment..." -ForegroundColor Yellow
# Add any environment setup logic here, such as importing modules, setting variables, etc.
# Example: Import-Module SomeModule
Import-Module powershell-yaml -ErrorAction SilentlyContinue Import-Module powershell-yaml -ErrorAction SilentlyContinue
Write-Host "PowerShell environment initialized." -ForegroundColor Green
} }
function Invoke-Main { function Invoke-Main {
Write-Host "Preparing environment..." -ForegroundColor Cyan Write-Host "Preparing environment..." -ForegroundColor Cyan
Write-Host Write-Host
Initialize-PowerShellEnvironment Write-Host "Initializing PowerShell environment..." -ForegroundColor Yellow
Import-PowerShellYamlModule
Write-Host "PowerShell environment initialized." -ForegroundColor Green
Write-Host Write-Host
Write-Host "Environment preparation complete!" -ForegroundColor Green Write-Host "Environment preparation complete!" -ForegroundColor Green
+48
View File
@@ -0,0 +1,48 @@
$setupToolsScript = (Resolve-Path -LiteralPath (Join-Path $PSScriptRoot '..\scripts\setup-tools.ps1')).Path
$expectedOutput = @(
'Preparing environment...'
''
'Initializing PowerShell environment...'
'PowerShell environment initialized.'
''
'Environment preparation complete!'
) -join "`n"
Describe 'setup-tools.ps1' {
It 'imports powershell-yaml and preserves the user-facing output' {
$originalModulePath = $env:PSModulePath
try {
$moduleRoot = Join-Path $TestDrive 'available-modules'
$moduleDirectory = Join-Path $moduleRoot 'powershell-yaml'
$null = New-Item -ItemType Directory -Path $moduleDirectory
Set-Content -LiteralPath (Join-Path $moduleDirectory 'powershell-yaml.psm1') -Value ''
$env:PSModulePath = $moduleRoot
$escapedScriptPath = $setupToolsScript.Replace("'", "''")
$command = "& '$escapedScriptPath'; if (-not (Get-Module -Name powershell-yaml)) { exit 42 }"
$output = @(& pwsh -NoProfile -Command $command 6>&1 | ForEach-Object { $_.ToString() })
$LASTEXITCODE | Should Be 0
($output -join "`n") | Should Be $expectedOutput
}
finally {
$env:PSModulePath = $originalModulePath
}
}
It 'continues successfully when powershell-yaml is unavailable' {
$originalModulePath = $env:PSModulePath
try {
$env:PSModulePath = Join-Path $TestDrive 'missing-modules'
$output = @(& pwsh -NoProfile -File $setupToolsScript 6>&1 | ForEach-Object { $_.ToString() })
$LASTEXITCODE | Should Be 0
($output -join "`n") | Should Be $expectedOutput
}
finally {
$env:PSModulePath = $originalModulePath
}
}
}