# Update-MtPack

Updates installed Maester Packs to their newest release that has met the cooldown, showing what changed.

Source: https://maester.dev/docs/commands/Update-MtPack

## SYNOPSIS

Updates installed Maester Packs to their newest release that has met the cooldown, showing what changed.

## SYNTAX

```powershell
Update-MtPack [[-Id] <String[]>] [-Version <String>] [-PackLock <String>] [-AcceptRisk <String>]
 [-IncludeRecent] [-NonInteractive] [-Force] [-Token <SecureString>] [-ProgressAction <ActionPreference>]
 [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION

Each pack is installed again from its source with the same checks as Install-MtPack: the cooldown, the
pack policy, the blocklist and the scan.
The approval shows what changed since the version you
approved: new services, scopes, network hosts, modules and a higher risk.
A pack whose newest release
has the files you approved is left as it is, without asking again, and reported as UpToDate.

## EXAMPLES

### EXAMPLE 1

```powershell
Update-MtPack
```

Updates every pack installed from GitHub.

### EXAMPLE 2

```powershell
Update-MtPack contoso.google-workspace -Version 1.3.0
```

Updates one pack to a given release.

### EXAMPLE 3

```powershell
Update-MtPack contoso.private-pack -Token (Get-Secret -Name PackReadToken)
```

Updates a pack from a private repository with a token read from a secret vault.

## PARAMETERS

### -Id

The packs to update.
By default every pack installed from GitHub.

```yaml
Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Version

The release to update to.
Only with one -Id.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -PackLock

The lock file to update.
By default the one beside the Maester config found from the current folder,
else the user's.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -AcceptRisk

The highest risk a pack may have to be updated without asking: Low, Medium or High.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: Low
Accept pipeline input: False
Accept wildcard characters: False
```

### -IncludeRecent

Update to a release that is newer than the cooldown.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -NonInteractive

Never ask.
Used automatically when the input is redirected.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -Force

Answer yes to the approval question.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -Token

A GitHub token that can read the pack's repository, as a SecureString, for a private or internal
repository.
It is used for this command only, is sent to api.github.com only, and is not stored.
When it
is given, no other sign-in is tried.
Without it, Maester uses the first of these that can read the
repository: the sign-in of Connect-MtGitHub in this session, the GitHub CLI (`gh auth token`, when gh is
installed and signed in), then the GH_TOKEN and GITHUB_TOKEN environment variables.
An environment
variable can be read by every process and module in the session, including installed packs, so prefer
the other ways outside a pipeline.
A fine-grained token needs only read-only Contents access to the
one repository.

```yaml
Type: SecureString
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf

Shows what would happen if the cmdlet runs.
The cmdlet is not run.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Confirm

Prompts you for confirmation before running the cmdlet.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ProgressAction

Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by Write-Progress.

```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

### System.Management.Automation.PSObject

## NOTES

## RELATED LINKS

[https://maester.dev/docs/commands/Update-MtPack](https://maester.dev/docs/commands/Update-MtPack)
