Skip to content

Latest commit

 

History

History
155 lines (114 loc) · 3.62 KB

Invoke-AvmDoctor.md

File metadata and controls

155 lines (114 loc) · 3.62 KB

Invoke-AvmDoctor

Synopsis

Diagnoses the local environment for running Avm.Authoring.

Description

Runs a fixed set of probes (PowerShell version, OS detection, AVM cache folder writability) and emits a structured result. The verb is fail-fast but does not throw: a failing check is reported in the Checks collection and reflected in the overall Status. Use the exit-code via the dispatcher when scripting.

With -Install, additionally walks every entry in avm.pins and installs any missing tool into the per-user cache (atomic stage->verify->rename through Install-AvmToolFromPins). Tools that do not ship a release for the current platform are reported as 'Skip', not 'Fail'.

CLI commands

  • avm doctor

Syntax

Invoke-AvmDoctor [[-PinsPath] <string>] [[-Path] <string>] [-Json] [-Install] [-Force] [-AllowFileUrls] [-SkipModuleVersionCheck] [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters

-AllowFileUrls

Test-only escape hatch (see Test-AvmPins). Hidden from help and tab-completion so it does not appear in the production surface.

Property Value
Type Switch
Required false
Position named
Default value False
Accept pipeline input false
Accept wildcard characters false

-Force

Combined with -Install, reinstall every tool even if a verified copy is already in the cache.

Property Value
Type Switch
Required false
Position named
Default value False
Accept pipeline input false
Accept wildcard characters false

-Install

After running diagnostics, install every tool in avm.pins that is not already cache-verified. Cache hits are reported as OK; per-platform unsupported tools are reported as Skip; any other install failure becomes a Fail without aborting the remaining tools.

Property Value
Type Switch
Required false
Position named
Default value False
Accept pipeline input false
Accept wildcard characters false

-Json

Emit the result as a single JSON document on stdout instead of as a pscustomobject. Matches the global '--json' contract from the spec.

Property Value
Type Switch
Required false
Position named
Default value False
Accept pipeline input false
Accept wildcard characters false

-Path

Module root whose tool-version-overrides.json applies. Bicep monorepos use their recognized repository root. Defaults to the current directory.

Property Value
Type String
Required false
Position 2
Default value $PWD.Path
Accept pipeline input false
Accept wildcard characters false

-PinsPath

Override the bundled Resources/avm.pins.jsonc. Intended for tests.

Property Value
Type String
Required false
Position 1
Default value
Accept pipeline input false
Accept wildcard characters false

-SkipModuleVersionCheck

Skip the PowerShell Gallery check that otherwise stops the command when a newer Avm.Authoring version is available. Writes a warning once.

Property Value
Type Switch
Required false
Position named
Default value False
Accept pipeline input false
Accept wildcard characters false

Examples

EXAMPLE 1

Invoke-AvmDoctor

EXAMPLE 2

avm doctor --json

EXAMPLE 3

avm doctor --install

Outputs

  • System.Management.Automation.PSObject