agentleFS
Microsoft AzureKnown publisherAzure/azure-functions-powershell-worker/.agents/skills/update-ps-sdk/SKILL.md

update-ps-sdk

Skill216 starsChanged 3 months agoMITView on GitHub

Upgrade the PowerShell SDK version in the Azure Functions PowerShell language worker. Use when: updating PowerShell SDK, upgrading PS version, bumping Microsoft.PowerShell.SDK, updating bundled modules, new PowerShell release.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Look up the .NET SDK version required by the target PowerShell SDK.

    line 26
  2. Very specific:

    Update the <TargetFramework> in both .csproj files if the .NET major version has changed:

    line 28
  3. Very specific:

    Update MinimalPatch and DefaultPatch in tools/helper.psm1 ($DotnetSDKVersionRequirements) to match the .NET SDK patch version from the …

    line 32
  4. Very specific:

    Keep the CI SDK installers aligned with every entry in $DotnetSDKVersionRequirements.

    line 34
  5. Very specific:

    Update the Microsoft.PowerShell.SDK <PackageReference> version in both project files:

    line 42
  6. Very specific:

    Check the PowerShell release notes for any new or updated dependencies required by the SDK.

    line 49
  7. Very specific:

    Update module versions in src/requirements.psd1 to match the versions shipped with the target release.

    line 57
  8. Very specific:

    Before building, verify that the exact .NET SDK versions derived from every DefaultPatch in tools/helper.psm1 appear in both CI templates.

    line 69
  9. Distinctive:

    Run a clean build with tests:

    line 71
  10. Distinctive:

    Run the vulnerability checker against the solution:

    line 86
  11. Distinctive:

    If vulnerabilities are found, update or pin the affected packages to non-vulnerable versions, then re-run steps 6 and 7.

    line 92

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Upgrade PowerShell SDK Version

Upgrades the PowerShell language worker to reference a new PowerShell SDK release.

When to Use

  • A new PowerShell SDK version is released on GitHub
  • You need to bump the Microsoft.PowerShell.SDK package version

Inputs

The user must provide (or you must confirm):

  • Target PS SDK version — e.g., 7.6.0-preview.5, 7.4.7
  • Release tag — typically v<version>, e.g., v7.6.0-preview.5

Procedure

1. Check the .NET SDK Requirement

Look up the .NET SDK version required by the target PowerShell SDK. The release notes at https://github.com/PowerShell/PowerShell/releases/tag/<releaseTag> list the exact .NET SDK version under Build and Packaging Improvements (e.g., "Update .NET SDK to 8.0.419").

  • Update the <TargetFramework> in both .csproj files if the .NET major version has changed:
    • src/Microsoft.Azure.Functions.PowerShellWorker.csproj
    • test/Unit/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj
  • Update MinimalPatch and DefaultPatch in tools/helper.psm1 ($DotnetSDKVersionRequirements) to match the .NET SDK patch version from the release notes. For example, if the release requires .NET SDK 8.0.419, set both values to '419'.
  • Keep the CI SDK installers aligned with every entry in $DotnetSDKVersionRequirements. Update the matching UseDotNet@2 task version in both templates:

    • eng/ci/templates/build.yml
    • eng/ci/templates/test.yml

    Each required SDK must use the exact DefaultPatch version from tools/helper.psm1. Do not remove unrelated SDK requirements such as the .NET 3.1 SDK used by Microsoft.ManifestTool.dll.

2. Update the PowerShell SDK Package Version

Update the Microsoft.PowerShell.SDK <PackageReference> version in both project files:

  • src/Microsoft.Azure.Functions.PowerShellWorker.csproj
  • test/Unit/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj

3. Update SDK Dependencies

Check the PowerShell release notes for any new or updated dependencies required by the SDK. For example, certain releases require a specific Microsoft.CodeAnalysis.CSharp version. Update these in both .csproj files as needed.

4. Remove Temporarily Pinned Transitives

Review both .csproj files for <PackageReference> entries that were pinned to work around transitive dependency issues (e.g., a vulnerable transitive that was pinned until the parent package updated it). If the new PowerShell SDK now pulls in a sufficiently new version of that transitive, remove the explicit pin rather than bumping it. Only keep explicit pins that are still necessary.

5. Update Bundled Module Versions

Update module versions in src/requirements.psd1 to match the versions shipped with the target release. The authoritative source for bundled module versions is:

https://github.com/PowerShell/PowerShell/blob/<releaseTag>/src/Modules/PSGalleryModules.csproj

Replace <releaseTag> with the actual tag (e.g., v7.6.0-preview.5).

The modules to check are listed in src/requirements.psd1 (e.g., Microsoft.PowerShell.Archive, ThreadJob, PowerShellGet, PackageManagement).

6. Build and Test

Before building, verify that the exact .NET SDK versions derived from every DefaultPatch in tools/helper.psm1 appear in both CI templates. Treat any missing or different UseDotNet@2 version as drift and fix it before continuing.

Run a clean build with tests:

pwsh -c "./build.ps1 -Clean -Test"

Address all build warnings. Common warnings to fix:

  • NU1605 (package downgrade) — update the pinned version or remove the pin if the SDK now provides a newer transitive.
  • NU1510 (unnecessary pinned package) — remove the <PackageReference> since the package is no longer needed as a direct dependency.
  • CS8632 and other code warnings — fix the underlying code issue.

Re-run the build until it completes with zero warnings and all tests passing.

7. Check for Vulnerable Packages

Run the vulnerability checker against the solution:

pwsh -c "./Check-CsprojVulnerabilities.ps1 -PrintReport"

If vulnerabilities are found, update or pin the affected packages to non-vulnerable versions, then re-run steps 6 and 7.

8. Submit PR

Submit a pull request to the dev branch. The dev branch always tracks the latest PowerShell version.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.