Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
// -----------------------------------------------------------------------------

namespace Microsoft.WinGet.Client.Commands
{
{
using System.Management.Automation;
using Microsoft.Management.Deployment;
using Microsoft.WinGet.Client.Commands.Common;
using Microsoft.WinGet.Client.Common;

using Microsoft.WinGet.Client.Common;
/// <summary>
/// Searches configured sources for packages.
/// </summary>
[Cmdlet(VerbsCommon.Find, Constants.WinGetNouns.Package)]
[OutputType(typeof(MatchResult))]
[OutputType(typeof(PSObjects.FoundCatalogPackage))]
public sealed class FindPackageCommand : BaseFinderExtendedCommand
{
/// <summary>
Expand All @@ -27,7 +27,7 @@ protected override void ProcessRecord()
var results = this.FindPackages(CompositeSearchBehavior.RemotePackagesFromRemoteCatalogs);
for (var i = 0; i < results.Count; i++)
{
this.WriteObject(results[i]);
this.WriteObject(new PSObjects.FoundCatalogPackage(results[i].CatalogPackage));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Microsoft.WinGet.Client.Commands
/// Searches configured sources for packages.
/// </summary>
[Cmdlet(VerbsCommon.Get, Constants.WinGetNouns.Package)]
[OutputType(typeof(CatalogPackage))]
[OutputType(typeof(PSObjects.InstalledCatalogPackage))]
public sealed class GetPackageCommand : BaseFinderExtendedCommand
{
/// <summary>
Expand All @@ -27,7 +27,7 @@ protected override void ProcessRecord()
var results = this.FindPackages(CompositeSearchBehavior.LocalCatalogs);
for (var i = 0; i < results.Count; i++)
{
this.WriteObject(results[i].CatalogPackage);
this.WriteObject(new PSObjects.InstalledCatalogPackage(results[i].CatalogPackage));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
namespace Microsoft.WinGet.Client.Commands
{
using System.Management.Automation;
using Microsoft.Management.Deployment;
using Microsoft.WinGet.Client.Commands.Common;
using Microsoft.WinGet.Client.Common;

/// <summary>
/// Retrieves the list of configured sources.
/// </summary>
[Cmdlet(VerbsCommon.Get, Constants.WinGetNouns.Source)]
[OutputType(typeof(PackageCatalogReference))]
[OutputType(typeof(PSObjects.SourceResult))]
public sealed class GetSourceCommand : BaseClientCommand
{
/// <summary>
Expand All @@ -36,7 +35,7 @@ protected override void ProcessRecord()
var results = GetPackageCatalogReferences(this.Name);
for (var i = 0; i < results.Count; i++)
{
this.WriteObject(results[i]);
this.WriteObject(new PSObjects.SourceResult(results[i]));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Microsoft.WinGet.Client.Commands
Constants.WinGetNouns.Package,
DefaultParameterSetName = Constants.FoundSet,
SupportsShouldProcess = true)]
[OutputType(typeof(InstallResult))]
[OutputType(typeof(PSObjects.InstallResult))]
public sealed class InstallPackageCommand : BaseInstallCommand
{
private ProcessorArchitecture architecture;
Expand Down Expand Up @@ -66,7 +66,7 @@ protected override void ProcessRecord()
{
InstallOptions options = this.GetInstallOptions(version);
InstallResult result = this.InstallPackage(package, options);
this.WriteObject(result);
this.WriteObject(new PSObjects.InstallResult(result));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Microsoft.WinGet.Client.Commands
Constants.WinGetNouns.Package,
DefaultParameterSetName = Constants.FoundSet,
SupportsShouldProcess = true)]
[OutputType(typeof(UninstallResult))]
[OutputType(typeof(PSObjects.UninstallResult))]
public sealed class UninstallPackageCommand : BasePackageCommand
{
/// <summary>
Expand All @@ -46,7 +46,7 @@ protected override void ProcessRecord()
{
UninstallOptions options = this.GetUninstallOptions(version);
UninstallResult result = this.UninstallPackage(package, options);
this.WriteObject(result);
this.WriteObject(new PSObjects.UninstallResult(result));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Microsoft.WinGet.Client.Commands
Constants.WinGetNouns.Package,
DefaultParameterSetName = Constants.FoundSet,
SupportsShouldProcess = true)]
[OutputType(typeof(InstallResult))]
[OutputType(typeof(PSObjects.InstallResult))]
public sealed class UpdatePackageCommand : BaseInstallCommand
{
/// <summary>
Expand Down
Loading