Skip to content

Commit fde9255

Browse files
authored
Add Optimize-Package (#77)
1 parent 42a434f commit fde9255

5 files changed

+128
-2
lines changed

docs/reference/AnyPackage.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Module Name: AnyPackage
33
Module Guid: 19cd4cdd-6766-4e47-be1c-76c33cea7392
44
Download Help Link: https://go.anypackage.dev/help
5-
Help Version: 0.5.1.0
5+
Help Version: 0.9.0.0
66
Locale: en-US
77
title: AnyPackage
88
has_children: true
@@ -37,6 +37,10 @@ Returns registered package source information.
3737

3838
Installs packages from package sources.
3939

40+
### [Optimize-Package](Optimize-Package.md)
41+
42+
Removes outdated packages.
43+
4044
### [Publish-Package](Publish-Package.md)
4145

4246
Publishes packages to package sources.

docs/reference/Optimize-Package.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
external help file: AnyPackage.dll-Help.xml
3+
Module Name: AnyPackage
4+
online version: https://go.anypackage.dev/Optimize-Package
5+
parent: AnyPackage
6+
schema: 2.0.0
7+
---
8+
9+
# Optimize-Package
10+
11+
## SYNOPSIS
12+
13+
Removes outdated packages.
14+
15+
## SYNTAX
16+
17+
```text
18+
Optimize-Package [[-Name] <string[]>] [-Provider <string>] [-PassThru]
19+
[-WhatIf] [-Confirm] [<CommonParameters>]
20+
```
21+
22+
## DESCRIPTION
23+
24+
Removes outdated packages.
25+
26+
## EXAMPLES
27+
28+
### Example 1: Optimize all packages
29+
30+
```powershell
31+
Optimize-Package
32+
33+
Name Version Source Provider
34+
---- ------- ---------- --------
35+
Microsoft.PowerShell.Archive 1.2.5.0 PSGallery PowerShellGet
36+
Microsoft.PowerShell.ConsoleGuiTools 0.7.2.0 PSGallery PowerShellGet
37+
```
38+
39+
The command removes outdated packages from registered package providers.
40+
41+
### Example 2: Optimize all package from a provider
42+
43+
```powershell
44+
Optimize-Package -Provider PowerShellGet
45+
46+
Name Version Source Provider
47+
---- ------- ---------- --------
48+
Microsoft.PowerShell.Archive 1.2.5.0 PSGallery PowerShellGet
49+
Microsoft.PowerShell.ConsoleGuiTools 0.7.2.0 PSGallery PowerShellGet
50+
```
51+
52+
The command removes outdated packages from `PowerShellGet` package provider.
53+
54+
## PARAMETERS
55+
56+
### -Name
57+
58+
Specifies the package name.
59+
60+
```yaml
61+
Type: String[]
62+
Parameter Sets: (All)
63+
Aliases:
64+
65+
Required: False
66+
Position: 0
67+
Default value: *
68+
Accept pipeline input: True (ByPropertyName, ByValue)
69+
Accept wildcard characters: True
70+
```
71+
72+
### -Provider
73+
74+
Specifies the package provider.
75+
76+
```yaml
77+
Type: String
78+
Parameter Sets: (All)
79+
Aliases:
80+
81+
Required: False
82+
Position: Named
83+
Default value: None
84+
Accept pipeline input: False
85+
Accept wildcard characters: False
86+
```
87+
88+
### CommonParameters
89+
90+
This cmdlet supports the common parameters: -Debug, -ErrorAction,
91+
-ErrorVariable, -InformationAction, -InformationVariable, -OutVariable,
92+
-OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
93+
For more information, see
94+
[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
95+
96+
## INPUTS
97+
98+
### System.String, AnyPackage.Provider.PackageVersionRange
99+
100+
You can pipe a package name to this cmdlet.
101+
102+
## OUTPUTS
103+
104+
### AnyPackage.Provider.PackageInfo
105+
106+
This cmdlet returns objects that represent a package.
107+
108+
## NOTES
109+
110+
## RELATED LINKS
111+
112+
[Find-Package](Find-Package.md)
113+
114+
[Install-Package](Install-Package.md)
115+
116+
[Publish-Package](Publish-Package.md)
117+
118+
[Save-Package](Save-Package.md)
119+
120+
[Update-Package](Update-Package.md)
121+
122+
[Uninstall-Package](Uninstall-Package.md)

help/AnyPackage_19cd4cdd-6766-4e47-be1c-76c33cea7392_HelpInfo.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<SupportedUICultures>
55
<UICulture>
66
<UICultureName>en-US</UICultureName>
7-
<UICultureVersion>0.5.1.0</UICultureVersion>
7+
<UICultureVersion>0.9.0.0</UICultureVersion>
88
</UICulture>
99
</SupportedUICultures>
1010
</HelpInfo>
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)