From ac9cc4c99bb129de562b3f6a781b27d881215bed Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 3 Dec 2025 10:16:45 +0000 Subject: [PATCH 1/6] Initial plan From 132f867764b5f18beb0688c6e42cd84ac74ec583 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 3 Dec 2025 10:23:28 +0000 Subject: [PATCH 2/6] Add check for powershell-YAML module in Test-Tooling.ps1 Co-authored-by: jtracey93 <41163455+jtracey93@users.noreply.github.com> --- src/ALZ/Private/Tools/Test-Tooling.ps1 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/ALZ/Private/Tools/Test-Tooling.ps1 b/src/ALZ/Private/Tools/Test-Tooling.ps1 index e3b18d6..54ddfe8 100644 --- a/src/ALZ/Private/Tools/Test-Tooling.ps1 +++ b/src/ALZ/Private/Tools/Test-Tooling.ps1 @@ -186,6 +186,22 @@ function Test-Tooling { } } + # Check if powershell-yaml module is installed + Write-Verbose "Checking powershell-yaml module installation" + $yamlModule = Get-Module -ListAvailable -Name powershell-yaml + if ($yamlModule) { + $checkResults += @{ + message = "powershell-yaml module is installed (version $($yamlModule.Version))." + result = "Success" + } + } else { + $checkResults += @{ + message = "powershell-yaml module is not installed. Please install it using 'Install-Module powershell-yaml -Force'." + result = "Failure" + } + $hasFailure = $true + } + Write-Verbose "Showing check results" Write-Verbose $(ConvertTo-Json $checkResults -Depth 100) $checkResults | ForEach-Object {[PSCustomObject]$_} | Format-Table -Property @{ From 45624e71addc90bca0ad4851f08c0487341688a6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 3 Dec 2025 13:36:08 +0000 Subject: [PATCH 3/6] Make YAML module check conditional based on input file type Co-authored-by: jtracey93 <41163455+jtracey93@users.noreply.github.com> --- src/ALZ/Private/Tools/Test-Tooling.ps1 | 32 +++++++++++++++----------- src/ALZ/Public/Deploy-Accelerator.ps1 | 27 +++++++++++++++++++++- 2 files changed, 44 insertions(+), 15 deletions(-) diff --git a/src/ALZ/Private/Tools/Test-Tooling.ps1 b/src/ALZ/Private/Tools/Test-Tooling.ps1 index 54ddfe8..904d262 100644 --- a/src/ALZ/Private/Tools/Test-Tooling.ps1 +++ b/src/ALZ/Private/Tools/Test-Tooling.ps1 @@ -2,7 +2,9 @@ function Test-Tooling { [CmdletBinding(SupportsShouldProcess = $true)] param( [Parameter(Mandatory = $false)] - [switch]$skipAlzModuleVersionCheck + [switch]$skipAlzModuleVersionCheck, + [Parameter(Mandatory = $false)] + [switch]$checkYamlModule ) $checkResults = @() @@ -186,20 +188,22 @@ function Test-Tooling { } } - # Check if powershell-yaml module is installed - Write-Verbose "Checking powershell-yaml module installation" - $yamlModule = Get-Module -ListAvailable -Name powershell-yaml - if ($yamlModule) { - $checkResults += @{ - message = "powershell-yaml module is installed (version $($yamlModule.Version))." - result = "Success" - } - } else { - $checkResults += @{ - message = "powershell-yaml module is not installed. Please install it using 'Install-Module powershell-yaml -Force'." - result = "Failure" + # Check if powershell-yaml module is installed (only when YAML files are being used) + if ($checkYamlModule.IsPresent) { + Write-Verbose "Checking powershell-yaml module installation" + $yamlModule = Get-Module -ListAvailable -Name powershell-yaml + if ($yamlModule) { + $checkResults += @{ + message = "powershell-yaml module is installed (version $($yamlModule.Version))." + result = "Success" + } + } else { + $checkResults += @{ + message = "powershell-yaml module is not installed. Please install it using 'Install-Module powershell-yaml -Force'." + result = "Failure" + } + $hasFailure = $true } - $hasFailure = $true } Write-Verbose "Showing check results" diff --git a/src/ALZ/Public/Deploy-Accelerator.ps1 b/src/ALZ/Public/Deploy-Accelerator.ps1 index b752e3e..b2944a4 100644 --- a/src/ALZ/Public/Deploy-Accelerator.ps1 +++ b/src/ALZ/Public/Deploy-Accelerator.ps1 @@ -171,11 +171,36 @@ function Deploy-Accelerator { $ProgressPreference = "SilentlyContinue" + # Determine if any input files are YAML to check for powershell-yaml module + $hasYamlFiles = $false + if ($inputConfigFilePaths.Length -gt 0) { + foreach ($path in $inputConfigFilePaths) { + $extension = [System.IO.Path]::GetExtension($path).ToLower() + if ($extension -eq ".yml" -or $extension -eq ".yaml") { + $hasYamlFiles = $true + break + } + } + } else { + # Check environment variable if no paths provided + $envInputConfigPaths = $env:ALZ_input_config_path + if ($null -ne $envInputConfigPaths -and $envInputConfigPaths -ne "") { + $envPaths = $envInputConfigPaths -split "," + foreach ($path in $envPaths) { + $extension = [System.IO.Path]::GetExtension($path).ToLower() + if ($extension -eq ".yml" -or $extension -eq ".yaml") { + $hasYamlFiles = $true + break + } + } + } + } + if ($skip_requirements_check.IsPresent) { Write-InformationColored "WARNING: Skipping the software requirements check..." -ForegroundColor Yellow -InformationAction Continue } else { Write-InformationColored "Checking the software requirements for the Accelerator..." -ForegroundColor Green -InformationAction Continue - Test-Tooling -skipAlzModuleVersionCheck:$skip_alz_module_version_requirements_check.IsPresent + Test-Tooling -skipAlzModuleVersionCheck:$skip_alz_module_version_requirements_check.IsPresent -checkYamlModule:$hasYamlFiles } Write-InformationColored "Getting ready to deploy the accelerator with you..." -ForegroundColor Green -NewLineBefore -InformationAction Continue From f05eb110e43a918f59d6b5a241033b8ef828a925 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 3 Dec 2025 13:38:37 +0000 Subject: [PATCH 4/6] Add path validation and error handling for YAML detection Co-authored-by: jtracey93 <41163455+jtracey93@users.noreply.github.com> --- src/ALZ/Public/Deploy-Accelerator.ps1 | 30 +++++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/ALZ/Public/Deploy-Accelerator.ps1 b/src/ALZ/Public/Deploy-Accelerator.ps1 index b2944a4..b5036a7 100644 --- a/src/ALZ/Public/Deploy-Accelerator.ps1 +++ b/src/ALZ/Public/Deploy-Accelerator.ps1 @@ -175,22 +175,34 @@ function Deploy-Accelerator { $hasYamlFiles = $false if ($inputConfigFilePaths.Length -gt 0) { foreach ($path in $inputConfigFilePaths) { - $extension = [System.IO.Path]::GetExtension($path).ToLower() - if ($extension -eq ".yml" -or $extension -eq ".yaml") { - $hasYamlFiles = $true - break + if ($null -ne $path -and $path.Trim() -ne "") { + try { + $extension = [System.IO.Path]::GetExtension($path).ToLower() + if ($extension -eq ".yml" -or $extension -eq ".yaml") { + $hasYamlFiles = $true + break + } + } catch { + # Ignore invalid paths - they will be caught later during config file validation + continue + } } } } else { # Check environment variable if no paths provided $envInputConfigPaths = $env:ALZ_input_config_path if ($null -ne $envInputConfigPaths -and $envInputConfigPaths -ne "") { - $envPaths = $envInputConfigPaths -split "," + $envPaths = $envInputConfigPaths -split "," | Where-Object { $_ -and $_.Trim() } foreach ($path in $envPaths) { - $extension = [System.IO.Path]::GetExtension($path).ToLower() - if ($extension -eq ".yml" -or $extension -eq ".yaml") { - $hasYamlFiles = $true - break + try { + $extension = [System.IO.Path]::GetExtension($path).ToLower() + if ($extension -eq ".yml" -or $extension -eq ".yaml") { + $hasYamlFiles = $true + break + } + } catch { + # Ignore invalid paths - they will be caught later during config file validation + continue } } } From 4986384bfb2265837a9aa3c85f64aeb602d88ce1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 3 Dec 2025 14:04:30 +0000 Subject: [PATCH 5/6] Consolidate duplicated YAML file detection logic Co-authored-by: jaredfholgate <1612200+jaredfholgate@users.noreply.github.com> --- src/ALZ/Public/Deploy-Accelerator.ps1 | 42 +++++++++++---------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/src/ALZ/Public/Deploy-Accelerator.ps1 b/src/ALZ/Public/Deploy-Accelerator.ps1 index b5036a7..fdf8b3c 100644 --- a/src/ALZ/Public/Deploy-Accelerator.ps1 +++ b/src/ALZ/Public/Deploy-Accelerator.ps1 @@ -173,37 +173,29 @@ function Deploy-Accelerator { # Determine if any input files are YAML to check for powershell-yaml module $hasYamlFiles = $false + $pathsToCheck = @() + if ($inputConfigFilePaths.Length -gt 0) { - foreach ($path in $inputConfigFilePaths) { - if ($null -ne $path -and $path.Trim() -ne "") { - try { - $extension = [System.IO.Path]::GetExtension($path).ToLower() - if ($extension -eq ".yml" -or $extension -eq ".yaml") { - $hasYamlFiles = $true - break - } - } catch { - # Ignore invalid paths - they will be caught later during config file validation - continue - } - } - } + $pathsToCheck = $inputConfigFilePaths } else { # Check environment variable if no paths provided $envInputConfigPaths = $env:ALZ_input_config_path if ($null -ne $envInputConfigPaths -and $envInputConfigPaths -ne "") { - $envPaths = $envInputConfigPaths -split "," | Where-Object { $_ -and $_.Trim() } - foreach ($path in $envPaths) { - try { - $extension = [System.IO.Path]::GetExtension($path).ToLower() - if ($extension -eq ".yml" -or $extension -eq ".yaml") { - $hasYamlFiles = $true - break - } - } catch { - # Ignore invalid paths - they will be caught later during config file validation - continue + $pathsToCheck = $envInputConfigPaths -split "," | Where-Object { $_ -and $_.Trim() } + } + } + + foreach ($path in $pathsToCheck) { + if ($null -ne $path -and $path.Trim() -ne "") { + try { + $extension = [System.IO.Path]::GetExtension($path).ToLower() + if ($extension -eq ".yml" -or $extension -eq ".yaml") { + $hasYamlFiles = $true + break } + } catch { + # Ignore invalid paths - they will be caught later during config file validation + continue } } } From f6e5ff0952ffac1177bccd41ace43ba032ce5eb0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 3 Dec 2025 14:19:22 +0000 Subject: [PATCH 6/6] Remove trailing whitespace from Deploy-Accelerator.ps1 Co-authored-by: jaredfholgate <1612200+jaredfholgate@users.noreply.github.com> --- src/ALZ/Public/Deploy-Accelerator.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ALZ/Public/Deploy-Accelerator.ps1 b/src/ALZ/Public/Deploy-Accelerator.ps1 index fdf8b3c..da457e2 100644 --- a/src/ALZ/Public/Deploy-Accelerator.ps1 +++ b/src/ALZ/Public/Deploy-Accelerator.ps1 @@ -174,7 +174,7 @@ function Deploy-Accelerator { # Determine if any input files are YAML to check for powershell-yaml module $hasYamlFiles = $false $pathsToCheck = @() - + if ($inputConfigFilePaths.Length -gt 0) { $pathsToCheck = $inputConfigFilePaths } else {