Skip to content

Port five workloads to the native PowerShell workload engine - #176

Open
AmirMS (AmelBawa-msft) wants to merge 1 commit into
mainfrom
user/amelbawa/port-workloads
Open

AmirMS (AmelBawa-msft) wants to merge 1 commit into
mainfrom
user/amelbawa/port-workloads

Conversation

@AmelBawa-msft

Copy link
Copy Markdown
Collaborator

Summary

  • Move TypeScript, Java, Python, SQL Developer, and PowerShell from WinGet DSC configurations to native Windows Dev Config workloads.
  • Add workload definitions, setup entry points, and reusable steps for package installation, TypeScript, VS Code extensions, and PSScriptAnalyzer settings.
  • Make SQL Server Developer installs idempotent when WinGet reports an unknown installed version.
  • Update the manifest and developer/workload documentation. Mark the five flows for manual testing until the signed payload is refreshed.

Validation

  • Tested all five workloads in Windows 11 VMs; their install and smoke checks passed.
  • Confirmed SQL Server connectivity with sqlcmd.
  • PowerShell analyzer settings preservation checks passed.
  • WinGet source regression checks passed (40 passed, 0 failed); manifest and PowerShell parsing checks and git diff --check passed.

@AmelBawa-msft
AmirMS (AmelBawa-msft) marked this pull request as ready for review October 12, 2026 22:07

@ranm-msft ranm-msft left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One substantive note inline on powershell-analyzer.ps1 about the settings.json round trip. It is inherited from the workload this replaces, so I am treating it as a scope call rather than a blocker.

The rest of the conversion reads cleanly: the workload definitions are straightforward phase manifests, the new manual_test: true entries carry an explicit reason, and the AnyVersion catalog entry is commented.

$settings = Read-DevConfigVSCodeSettings
$settings['powershell.scriptAnalysis.enable'] = $true
$settings['powershell.scriptAnalysis.settingsPath'] = $analyzerSettingsPath
ConvertTo-Json -InputObject $settings -Depth 100 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read-DevConfigVSCodeSettings turns the user's JSONC settings.json into a hashtable (comments stripped at L55-56 so ConvertFrom-Json will accept it), and this line serializes that hashtable straight back over the original file. Comments are not represented in the hashtable, so configuring the analyzer silently deletes every comment from the developer's VS Code settings and reflows the file. settings.json is JSONC and people do comment it.

To be fair this is carried forward rather than introduced here - the deleted src/Workloads/powershell/configuration.winget did the same Read-VSCodeSettings strip plus ConvertTo-Json -Depth 100 | Set-Content. So this is a scope call, not a regression.

Two related notes:

  • The block-comment regex at L55 is not string-aware, so a value like "example": "keep/*this*/text" parses as keeptext and gets written back corrupted.
  • Dropping L55-56 would not fix it on its own: PowerShell 7's ConvertFrom-Json already tolerates comments, and they would still be lost on the ConvertTo-Json round trip. The write path has to preserve the original source text.

Would you consider a source-preserving edit that touches only the two powershell.scriptAnalysis.* properties? src/tests/calm-os/powershell-analyzer-checks.ps1 already seeds a fixture containing a comment but only asserts the unrelated files.autoSave key survives, so it passes with the comment deleted - a raw-content assertion there would pin the behaviour either way. If that is out of scope for a conversion PR, tracking it as a follow-up is fine by me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants