| external help file | PSPublishModule-help.xml |
|---|---|
| Module Name | PSPublishModule |
| online version | https://github.com/EvotecIT/PSPublishModule |
| schema | 2.0.0 |
Repairs and verifies installed PowerShell modules through the managed module-state engine.
Repair-ManagedModule [[-Name] <string[]>] [-InstallMissing] [-RequiredResource <Object>] [-RequiredResourceFile <string>] [-Inventory <ModuleStateInventoryResult>] [-InventoryPath <string>] [-ModulePath <string[]>] [-UserProfilePath <string[]>] [-IncludeAllUserProfiles] [-IncludeLoaded] [-MaintenanceReceiptPath <string[]>] [-Latest] [-Version <string>] [-MinimumVersion <string>] [-VersionPolicy <string>] [-Cleanup <string>] [-Family <string[]>] [-Scope <string>] [-ProfileName <string>] [-Repository <string>] [-Transport <ModuleStateDeliveryTransport>] [-ModuleRoot <string>] [-Prerelease] [-Force] [-AllowClobber] [-AcceptLicense] [-SkipDependencyCheck] [-AllowConflict] [-Plan] [-ShowSummary] [-Credential <pscredential>] [-CredentialUserName <string>] [-CredentialSecret <string>] [-CredentialSecretFilePath <string>] [-WhatIf] [-Confirm] [<CommonParameters>]This command is the managed operator surface for module estate maintenance. It inventories installed modules, plans stale-version, receipt-drift, source, scope, family, and cleanup actions, and can apply the plan through the managed delivery engine.
PSResourceGet has no equivalent estate-repair command. Use the lifecycle cmdlets for one requested operation and this command when the desired outcome spans installed-state discovery, drift analysis, repair, and cleanup.
Repair keeps module copies in separate physical roots, PowerShell editions, scopes, and local user profiles independent. Missing modules require an explicit ModuleRoot or exactly one eligible scanned root; ambiguous destinations are reported and blocked. A single explicit UserProfilePath supplies the current PowerShell edition's standard CurrentUser root even when that root does not exist yet; it never overrides an AllUsers request. Explicit ModuleRoot and profile destinations are merged into supplied Inventory or InventoryPath artifacts and remain part of convergence scans. Module roots declared by maintenance receipts are merged the same way, including roots that do not exist until repair delivery creates them. A successfully enumerated explicit root replaces stale artifact rows and diagnostics for that root, even when the live root is empty.
Live apply performs delivery, inventories the same estate again, replans exact-path old-version cleanup from current state. Cleanup requires that refreshed plan to be error-free, preflights the complete exact-path removal set, validates loaded-module and dependency safety across relevant global/profile roots, and removes selected dependents before their selected dependencies. Current-runspace loaded modules are protected even when IncludeLoaded is not used for inventory output. A declined delivery or cleanup action is reported as skipped and cannot be reported as successful convergence. Repair performs a final live inventory and returns post-apply plan and convergence evidence after execution or a no-action apply. Operational failures remain visible in the typed result and are also written as nonterminating errors.
This is local-machine estate management suitable for workstations and servers, including service-account and multi-profile roots. It does not connect to or orchestrate remote computers; invoke it in each target session or through the operator's existing remoting/configuration system.
Repair-ManagedModule -Latest -Repository PSGallery -Plan -ShowSummaryRepair-ManagedModule -Family Graph -Repository PSGallery -Plan -ShowSummaryRepair-ManagedModule -Name Company.Tools,Company.Web -InstallMissing -Latest -Repository PSGallery -Plan -ShowSummaryRepair-ManagedModule -RequiredResourceFile .\required-resources.psd1 -Latest -Repository PSGallery -Plan -ShowSummaryRepair-ManagedModule -MaintenanceReceiptPath .\module-maintenance.json -ProfileName CompanyModules -AcceptLicenseRepair-ManagedModule -ModulePath $ps5Root,$ps7Root -Latest -Cleanup OldVersions -Repository PSGallery -Plan -ShowSummaryRepair-ManagedModule -UserProfilePath C:\Users\Alice,C:\Users\Service.PowerShell -Name Company.* -Latest -Repository CompanyModules -Plan -ShowSummaryRepair-ManagedModule -IncludeAllUserProfiles -Latest -Cleanup OldVersions -Repository CompanyModules -Confirm:$false -ShowSummaryAccept package licenses when packages declare license acceptance is required.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueAllow managed delivery to overwrite exported command conflicts.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueAllow apply preparation to continue when the plan contains error findings.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueOptional old-version cleanup. Live apply replans after delivery, requires an error-free refreshed estate, batch-preflights exact paths, and removes selected dependents before dependencies.
Type: String
Parameter Sets: __AllParameterSets
Aliases: None
Possible values: None, OldVersions
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueOptional repository credential.
Type: PSCredential
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueOptional repository credential secret.
Type: String
Parameter Sets: __AllParameterSets
Aliases: Password, Token
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueOptional path to a file containing the repository credential secret.
Type: String
Parameter Sets: __AllParameterSets
Aliases: CredentialPath, TokenPath
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueOptional repository credential username.
Type: String
Parameter Sets: __AllParameterSets
Aliases: UserName
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueBuilt-in module family policies to include in repair planning.
Type: String[]
Parameter Sets: __AllParameterSets
Aliases: None
Possible values: MicrosoftGraph, Graph, Az, ExchangeOnline, Teams
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueForce reinstall when repair selects the same installed version.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueDiscover existing standard PowerShell module roots below the local profile container. Unix root sessions scan /home and retain /root; inaccessible optional profiles or roots are reported as warnings. Use UserProfilePath or ModulePath for redirected and custom layouts.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueInclude modules loaded in the current runspace as inventory and plan evidence. Cleanup protects current-runspace modules regardless of this reporting option.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TruePlan installs for literal names that are not present in the selected inventory.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueExisting inventory object. Explicit ModuleRoot and UserProfilePath destinations are merged into it and included in post-apply convergence scans.
Type: ModuleStateInventoryResult
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: TruePath to a previously written inventory JSON artifact.
Type: String
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TruePlan latest-version repair/update delivery for selected installed modules.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueOptional module-state maintenance receipt artifacts used for drift checks. Receipt-declared module roots are inventoried and retained for post-apply convergence.
Type: String[]
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueMinimum version used when repairing named modules.
Type: String
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueExplicit required module roots to inventory. Missing or inaccessible roots block apply. When omitted, optional roots inherited together from the current process's PSModulePath are treated as one dependency-visibility context.
Type: String[]
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueExplicit physical module root used to narrow inventory selection and managed delivery. It also resolves missing-module destination ambiguity.
Type: String
Parameter Sets: __AllParameterSets
Aliases: Path
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueOptional module names to repair. When omitted, all installed modules in scope are considered.
Type: String[]
Parameter Sets: __AllParameterSets
Aliases: ModuleName
Possible values:
Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: TrueReturn the full repair and cleanup plan without applying any actions.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueInclude prerelease versions during managed delivery.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: AllowPrerelease
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueSaved repository profile used by managed delivery.
Type: String
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueRepository source or registered repository name used by managed delivery.
Type: String
Parameter Sets: __AllParameterSets
Aliases: Source, RepositoryUri
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TruePSResourceGet-style required resource map used as desired module state.
Type: Object
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TruePath to a PowerShell data file containing a PSResourceGet-style required resource map.
Type: String
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueTarget installation scope used when selecting installed baseline modules.
Type: String
Parameter Sets: __AllParameterSets
Aliases: None
Possible values: CurrentUser, AllUsers
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueWrite a compact Spectre.Console summary.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueSkip installing dependencies declared by repaired packages.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases: SkipDependenciesCheck
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueDelivery transport used for install/update repair actions.
Type: ModuleStateDeliveryTransport
Parameter Sets: __AllParameterSets
Aliases: None
Possible values: PrivateModule, ManagedModule, Auto
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueExplicit user profile home directories whose platform-standard module roots are inventoried. Existing roots are required and block repair when inaccessible; a missing current-edition root remains a creatable destination. One explicit profile provides that CurrentUser destination for missing modules, but never overrides AllUsers scope.
Type: String[]
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueExact required version used when repairing named modules.
Type: String
Parameter Sets: __AllParameterSets
Aliases: RequiredVersion
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueNuGet-style version range policy used when repairing named modules.
Type: String
Parameter Sets: __AllParameterSets
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
System.String[] PSPublishModule.ModuleStateInventoryResult
PSPublishModule.ModuleStateWorkflowResult— PowerShell-facing result for a complete module-state management workflow.
- None