Skip to content

Fix export for filecontent resource - #1723

Open
Steve Lee (SteveL-MSFT) wants to merge 2 commits into
PowerShell:mainfrom
SteveL-MSFT:fix-filecontent-export
Open

Steve Lee (SteveL-MSFT) wants to merge 2 commits into
PowerShell:mainfrom
SteveL-MSFT:fix-filecontent-export

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

PR Summary

When the WG decided that file content should always be returned including get and not just for export there was no need to have a separate export operation since path is required and can fallback to get. Changes here:

  • remove export declaration from resource manifest, the supportsFiltering being false meant that the input wasn't be passed to the resource since the resource is expected to return all instances and have the engine perform filtering which doesn't make sense for this resource
  • remove the code implementation for export() since it's literally the same as get() now
  • update tests to go through dsc instead of calling the exe directly which masked this issue

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Update localized diagnostics so they no longer advertise the removed export operation.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates the FileContent resource to rely on DSC’s get fallback for export.

Changes:

  • Removes the redundant export declaration and implementation.
  • Updates export tests to use the DSC CLI.
  • Removes obsolete export dispatching.
File summaries
File Description
resources/filecontent/tests/filecontent_export.tests.ps1 Tests export through the DSC CLI.
resources/filecontent/src/main.rs Removes export dispatching.
resources/filecontent/src/file.rs Removes duplicate export logic.
resources/filecontent/filecontent.dsc.resource.json Removes the export declaration.

Review note: Localized diagnostics still advertise export as a supported operation and should be updated.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread resources/filecontent/src/main.rs
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