# Upgrade a dependency and fix the breakage in PowerShell with Atlas in 2026

> Atlas streamlines the complex process of upgrading PowerShell module dependencies, automatically identifying and fixing breaking changes reported by `Pester` and `PSScriptAnalyzer`.

In 2026, Atlas empowers PowerShell developers to efficiently upgrade dependencies and resolve breaking changes by orchestrating `PSResourceGet` for package management, interpreting `Pester` test failures, and precisely applying code fixes to your `.psm1` module files.

## Key takeaways

- Atlas drives `PSResourceGet` for precise PowerShell dependency upgrades.
- `Invoke-Pester` output directly guides Atlas's PowerShell code fixes.
- `webfetch` provides crucial release notes for accurate PowerShell migrations.
- Atlas uses `lsp` to inspect new PowerShell function signatures in upgraded packages.
- All PowerShell code changes are reviewed via unified diffs before commit.
- `PSScriptAnalyzer Invoke-Formatter` ensures consistent PowerShell code style after upgrades.

## How Atlas upgrades PowerShell module dependencies with PSResourceGet

Upgrading PowerShell module dependencies in 2026 often involves navigating breaking changes. Atlas simplifies this by driving `PSResourceGet` directly through `bash`, ensuring that the upgrade process for your `.psd1` manifest files is fully automated and its output is captured for analysis.

Atlas leverages its `bash` tool to execute `PSResourceGet` commands, such as `Install-Module -Name MyModule -RequiredVersion X.Y.Z`, directly within your PowerShell environment. This allows Atlas to perform dependency upgrades by interacting with the actual package manager, just as a developer would. When you initiate an upgrade, Atlas captures the complete output from `PSResourceGet`. If this output exceeds standard terminal limits, Atlas automatically saves it to a file, which you can then inspect using the `read` tool. This ensures that every detail of the upgrade process, including any warnings or errors from `PSResourceGet`, is available for Atlas to analyze and for you to review. Atlas builds its code index by AST declarations using tree-sitter, allowing it to understand the structure of your `.psm1` module and `.psd1` manifest files, including the modules pinned in your requirements.

## Identifying and fixing breaking changes in PowerShell modules

After a dependency upgrade, identifying breakage in PowerShell code is crucial. Atlas doesn't guess; it runs `Invoke-Pester` and reads the actual output from your `.ps1` files, pinpointing every compile or test failure with 100% accuracy before suggesting fixes.

Atlas uses the `bash` tool to execute your project's test suite with `Invoke-Pester`. It then meticulously reads the output, identifying specific test failures and compile errors within your `.psm1` and `.ps1` files. Instead of making assumptions, Atlas relies on the real compiler output to enumerate the exact breakage. Once errors are identified, Atlas employs its `edit` tool to propose and apply fixes to the affected callsites. For complex breaking changes, Atlas can utilize the `lsp` tool's `goToDefinition` operation. This allows the agent to inspect the new signatures and definitions within the upgraded package, providing precise context for repairs. For instance, if a cmdlet's parameter block in your `.psm1` file has changed, Atlas can navigate to the new definition and suggest the correct modification, ensuring your advanced functions remain functional.

## Leveraging release notes for PowerShell dependency migrations

When migrating PowerShell modules to a new major version, understanding breaking changes from release notes is vital. Atlas uses `webfetch` to pull the library's changelog, providing the agent with the exact context needed to apply 1:1 fixes that align with the actual breaking changes.

A major version upgrade often introduces significant breaking changes that require specific migration steps. Atlas addresses this by using its `webfetch` tool to retrieve the release notes or changelog for the upgraded dependency. This ensures that the agent has access to the authoritative documentation detailing what has changed and how to adapt. By having the breaking changes in context, Atlas can apply fixes that are not merely guesses but are informed by the library's official guidance. For example, if a cmdlet in a dependency has been renamed or its parameters altered, `webfetch` provides Atlas with the information to correctly update calls within your `.psm1` files, preventing trial-and-error and ensuring accurate, efficient repairs.

## Ensuring PowerShell code quality and consistency after upgrades

Maintaining high code quality in PowerShell after a dependency upgrade is straightforward with Atlas. It can automatically clear `PSScriptAnalyzer` warnings and run `Invoke-Formatter` over the diff, ensuring your `.ps1` files adhere to your team's 2026 coding standards.

After applying fixes for breaking changes, Atlas helps maintain the overall quality and consistency of your PowerShell codebase. It can be instructed to address `PSScriptAnalyzer` warnings, which are crucial for adhering to best practices and coding standards. Furthermore, Atlas can run `PSScriptAnalyzer Invoke-Formatter` over the diff of its changes. This ensures that any modifications made to your `.psm1` or `.ps1` files are automatically formatted according to your project's established style guidelines. This automated formatting step, performed behind a permission prompt, prevents style inconsistencies from creeping into your codebase during dependency migrations, keeping your PowerShell modules clean and readable for all developers in 2026.

## Reviewing and committing dependency upgrade changes in PowerShell

Before committing any dependency upgrade changes in PowerShell, Atlas provides a robust review process. Every file edit generates a unified diff, allowing you to approve or reject changes with granular control, ensuring your `.psm1` and `.psd1` files are updated exactly as intended.

Atlas prioritizes developer control and safety throughout the dependency upgrade workflow. Every action Atlas takes, from running `PSResourceGet` to applying code fixes with `edit`, is permission-gated against allow, ask, and deny rules. Before writing any changes to your `.psm1`, `.psd1`, or `.ps1` files, Atlas computes a unified diff for every proposed edit and surfaces it for your approval. This allows you to review every line of code Atlas intends to modify. Atlas also reads `git` branches, status, and diffs, and can stage and create commits on your behalf after you have approved the changes. It snapshots file changes as `git` patches, providing a clear audit trail and the ability to roll back edits if necessary, giving you complete confidence in the integrity of your PowerShell project.

## Steps

1. Run Atlas in your PowerShell module directory, ensuring your `.psm1` module and `.psd1` manifest files are present.
2. Ask Atlas to upgrade the desired dependency by executing `PSResourceGet Install-Module -Name MyModule -RequiredVersion X.Y.Z` via the `bash` tool.
3. Instruct Atlas to fetch the release notes for the upgraded dependency using the `webfetch` tool to understand breaking changes.
4. Tell Atlas to run your test suite by executing `Invoke-Pester` via the `bash` tool to identify initial test failures.
5. Approve Atlas's `edit` suggestions to fix breaking changes, utilizing the `lsp` tool's `goToDefinition` to inspect new PowerShell function signatures.
6. Repeat running `Invoke-Pester` via `bash` and approving `edit` fixes until all tests pass and no compile errors remain.
7. Have Atlas clear `PSScriptAnalyzer` warnings and run `PSScriptAnalyzer Invoke-Formatter` over the diff of the changes.
8. Review the full unified diff of all proposed changes and approve Atlas's `git commit` action to finalize the upgrade.

## FAQ

### How does Atlas handle PowerShell module dependency conflicts?

Atlas uses the `bash` tool to execute `PSResourceGet` commands, allowing it to directly interact with the PowerShell package manager and resolve conflicts as `PSResourceGet` would, capturing all output for analysis. This ensures that Atlas works within the established PowerShell ecosystem.

### Can Atlas fix breaking changes in PowerShell advanced functions?

Yes, Atlas is designed to read your exported cmdlets and `param` blocks in `.psm1` files. It uses the `edit` tool to apply fixes to advanced functions based on `Pester` failures and `lsp` insights into new signatures, ensuring your custom cmdlets remain functional.

### How does Atlas ensure safety when modifying PowerShell code?

Atlas operates with permission-gated tool calls. It drafts a plan in a read-only agent, asks for approval before executing, computes a unified diff for every edit, and requires approval before writing any changes to your `.ps1` or `.psm1` files, providing full transparency and control.

### Does Atlas support custom PowerShell formatting rules?

Yes, Atlas can be instructed to run `PSScriptAnalyzer Invoke-Formatter` over the diff of its changes. If your project has a `.psd1` or `.psm1` file with specific `PSScriptAnalyzer` settings, Atlas will honor those rules, maintaining your team's coding standards.

### How does Atlas integrate with Git for PowerShell projects?

Atlas reads `git` branches, status, and diffs. It can stage and create commits on your behalf after you approve the changes. It also snapshots file changes as `git` patches, enabling easy rollback of edits and providing a clear history for your PowerShell modules.

### Can Atlas help with `Pester` test suite migrations?

Absolutely. Atlas can read your existing `.Tests.ps1` files, identify failures reported by `Invoke-Pester`, and use its `edit` tool to update test assertions or mock setups to align with the upgraded dependency's behavior, ensuring your test suites remain valid.

### What if the PowerShell dependency upgrade output is very long?

If the output from `PSResourceGet` or `Invoke-Pester` exceeds typical terminal limits, Atlas automatically saves it to a file. You can then use the `read` tool to inspect the full output and understand any complex issues or warnings generated during the upgrade process.

---

Canonical HTML: https://runatlas.sh/resources/stacks/upgrade-a-dependency-and-fix-the-breakage-in-powershell
Source of truth: aeo_pages row `/resources/stacks/upgrade-a-dependency-and-fix-the-breakage-in-powershell` (segment: Stacks) (this file is generated from it, never hand-edited).
Licence: Atlas is proprietary with a free core. It is not open source and there is no public source repository.
