Skip to content

The trust report calls it a failure while printing the volume saying otherwise #105

Description

@ALERTua

Reported on #72 by the reporter of #3, whose machine answers in German and has FDVDenyWriteAccess set. Their run printed this:

Marking Dev Drive E: as trusted for Defender performance
Could not mark E: as trusted (fsutil exited with code 1).
fsutil devdrv query E: said:
  This is a trusted Dev Drive.
  Dev Drives are protected by anti-virus filters.
  Currently attached dev drive filters:
  WdFilter
The Dev Drive will still work, but without the Defender performance mode trust enables.
Retry by hand with: fsutil devdrv trust /f E:

The first line says the volume is not trusted. The next four are the volume saying it is. A reader has to decide which half of our own message to believe.

Where it comes from

Resolve-DevDriveTrustReport has three branches. Two of them are careful:

  • exit 0 and the English phrase matched — report it trusted
  • exit 0 and anything else — say so plainly, print what the volume said, and let the reader judge, because the phrase is localized and nothing else on the machine carries the designation

The third is not. On a non-zero exit it returns Outcome = 'Failed' and asserts three things it has not established: that the volume was not marked, that Defender will not run in performance mode, and that a retry is what to do about it. The query output is printed underneath, unread.

This is the repository's own rule turned around. AGENTS.md says never to report success from an exit code alone — but reporting failure from one, while holding a read-back that disagrees, is the same mistake pointing the other way.

What to do

Treat a non-zero exit like the localized case: report what happened without concluding what it means.

  • Say that fsutil returned an error code, and give the code.
  • Print what the volume answered, as the other branch already does.
  • Do not claim the volume is untrusted, and do not claim Defender will run without performance mode. Neither is known.
  • The retry line can stay: it is advice, not a verdict, and it costs nothing if the volume is already trusted.

Both careful branches already exist as worked examples in the same function, so this is aligning the third with them rather than inventing anything.

Not established, and worth a line in the answer rather than a guess

Why fsutil devdrv trust /f returns 1 on a volume that is trusted. It could be "already trusted" — a volume formatted with Format-Volume -DevDrive may carry the designation before the call is made — or something about the forced dismount on a virtual disk. It has been seen exactly once, on that machine, and no reasoning here should pretend otherwise.

Scope

dev_drive.ps1: the third branch of Resolve-DevDriveTrustReport. dev_drive.Tests.ps1: the branch already has tests; they pin the wording that is wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions