Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/reference/AnyPackage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Module Name: AnyPackage
Module Guid: 19cd4cdd-6766-4e47-be1c-76c33cea7392
Download Help Link: https://go.anypackage.dev/help
Help Version: 0.5.1.0
Help Version: 0.9.0.0
Locale: en-US
title: AnyPackage
has_children: true
Expand Down Expand Up @@ -37,6 +37,10 @@ Returns registered package source information.

Installs packages from package sources.

### [Optimize-Package](Optimize-Package.md)

Removes outdated packages.

### [Publish-Package](Publish-Package.md)

Publishes packages to package sources.
Expand Down
122 changes: 122 additions & 0 deletions docs/reference/Optimize-Package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
external help file: AnyPackage.dll-Help.xml
Module Name: AnyPackage
online version: https://go.anypackage.dev/Optimize-Package
parent: AnyPackage
schema: 2.0.0
---

# Optimize-Package

## SYNOPSIS

Removes outdated packages.

## SYNTAX

```text
Optimize-Package [[-Name] <string[]>] [-Provider <string>] [-PassThru]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION

Removes outdated packages.

## EXAMPLES

### Example 1: Optimize all packages

```powershell
Optimize-Package

Name Version Source Provider
---- ------- ---------- --------
Microsoft.PowerShell.Archive 1.2.5.0 PSGallery PowerShellGet
Microsoft.PowerShell.ConsoleGuiTools 0.7.2.0 PSGallery PowerShellGet
```

The command removes outdated packages from registered package providers.

### Example 2: Optimize all package from a provider

```powershell
Optimize-Package -Provider PowerShellGet

Name Version Source Provider
---- ------- ---------- --------
Microsoft.PowerShell.Archive 1.2.5.0 PSGallery PowerShellGet
Microsoft.PowerShell.ConsoleGuiTools 0.7.2.0 PSGallery PowerShellGet
```

The command removes outdated packages from `PowerShellGet` package provider.

## PARAMETERS

### -Name

Specifies the package name.

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

Required: False
Position: 0
Default value: *
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: True
```

### -Provider

Specifies the package provider.

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

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

### System.String, AnyPackage.Provider.PackageVersionRange

You can pipe a package name to this cmdlet.

## OUTPUTS

### AnyPackage.Provider.PackageInfo

This cmdlet returns objects that represent a package.

## NOTES

## RELATED LINKS

[Find-Package](Find-Package.md)

[Install-Package](Install-Package.md)

[Publish-Package](Publish-Package.md)

[Save-Package](Save-Package.md)

[Update-Package](Update-Package.md)

[Uninstall-Package](Uninstall-Package.md)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<SupportedUICultures>
<UICulture>
<UICultureName>en-US</UICultureName>
<UICultureVersion>0.5.1.0</UICultureVersion>
<UICultureVersion>0.9.0.0</UICultureVersion>
</UICulture>
</SupportedUICultures>
</HelpInfo>
Binary file not shown.
Binary file not shown.