Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Microsoft.WinGet.Client PowerShell Module files #2314

Merged
merged 28 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
092260c
Initial commit of Microsoft.WinGet.Client project files.
jontab Jul 7, 2022
ca6d781
Fixed AppInstallerCLI.sln encoding change.
jontab Jul 7, 2022
ee45b51
Fixed BaseFinderCommand.cs typo.
jontab Jul 7, 2022
b36e395
Changed expect.txt for check-spelling-bot.
jontab Jul 7, 2022
48977f0
Changed expect.txt for check-spelling-bot again.
jontab Jul 7, 2022
da7b783
Changed expect.txt for check-spelling-bot another time.
jontab Jul 7, 2022
45b4404
Changed error messages to use localized strings; build script. Integr…
jontab Jul 12, 2022
08bc0af
Changed version logic; exact behavior; and attached all results to va…
jontab Jul 12, 2022
bd0e70f
Merge remote-tracking branch 'upstream/master' into user/t-jabbott/po…
jontab Jul 13, 2022
4d650ba
Fixed configuration mapping
jontab Jul 14, 2022
61b5c79
Spelling
jontab Jul 14, 2022
13dba24
Remove PlatyPS until ready; slight tweaks. Replace command with Enabl…
jontab Jul 19, 2022
91f8a4a
Minor changes and lower minimum platform version
jontab Jul 19, 2022
b6a7ec7
Organize and enhance comments
jontab Jul 19, 2022
1289fbb
Change build script to be pipeline friendly
jontab Jul 20, 2022
c874024
Initial pipeline pass
jontab Jul 20, 2022
1965b42
Call winrtact_Initialize from type initializer
jontab Jul 20, 2022
b3b906e
Spelling
Jul 20, 2022
5c0d48e
Merge branch 'master' into user/t-jabbott/powershell
jontab Jul 20, 2022
fce3e48
Localized progress record activities
jontab Jul 21, 2022
1b0e281
Merge remote-tracking branch 'upstream/master' into user/t-jabbott/po…
jontab Jul 21, 2022
90783ee
Merge branch 'user/t-jabbott/powershell-staging' into user/t-jabbott/…
jontab Jul 21, 2022
0cd730b
Merge branch 'master' of https://github.com/microsoft/winget-cli into…
jontab Jul 21, 2022
04e93f1
Download artifacts before publishing
jontab Jul 21, 2022
8aa5a4e
Merge branch 'user/t-jabbott/powershell-staging' of https://github.co…
jontab Jul 21, 2022
d8e4fe4
Merge branch 'master' of https://github.com/microsoft/winget-cli into…
jontab Jul 21, 2022
04960da
Add event to ensure winrtact.dll is copied
jontab Jul 25, 2022
85f3a8c
Change to copy correct configuration
jontab Jul 26, 2022
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
12 changes: 11 additions & 1 deletion .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ bomgar
BOMs
boundparms
brk
Browsable
Buf
buildtransitive
BUILTINS
cancelledbyuser
casemap
Expand Down Expand Up @@ -82,6 +84,7 @@ COMGLB
commandline
Concat
contactsupport
contentfiles
contoso
contractversion
count'th
Expand Down Expand Up @@ -225,6 +228,7 @@ learnxinyminutes
lhs
libsolv
libyaml
Lifecycle
Linq
liv
liwpx
Expand All @@ -234,6 +238,7 @@ localizationpriority
LPBYTE
LPDWORD
lpitemidlist
LPITEMIDLIST
LPWCH
LPWSTR
LSTATUS
Expand Down Expand Up @@ -293,8 +298,9 @@ objidl
ofile
Outptr
packageinuse
PACL
PARAMETERMAP
paramref
PACL
pathparts
Patil
pb
Expand All @@ -317,6 +323,7 @@ pri
processthreads
productcode
pscustomobject
psd
pseudocode
psm
psobject
Expand Down Expand Up @@ -379,6 +386,7 @@ startswith
streambuf
STRRET
strtoull
stylecop
subdir
subkey
superstring
Expand Down Expand Up @@ -456,6 +464,7 @@ winerror
wingetcreate
wingetdev
winreg
winrtact
withstarts
wn
Workflows
Expand All @@ -464,6 +473,7 @@ wsv
wto
wwinmain
WZDNCRFJ
XFile
XPLATSTR
xsi
yamlcreateps
Expand Down
40 changes: 40 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,12 @@ jobs:
TargetFolder: '$(artifactsDir)'
condition: succeededOrFailed()

- task: PowerShell@2
displayName: 'Copy PowerShell Module Binaries to Output'
inputs:
filePath: 'src\PowerShell\Microsoft.WinGet.Client\Copy-PlatformBinaries.ps1'
arguments: '-Platform $(buildPlatform) -Configuration $(buildConfiguration) -OutDir $(artifactsDir)\PowerShell'

- task: PublishPipelineArtifact@1
displayName: Publish Pipeline Artifacts
inputs:
Expand All @@ -327,3 +333,37 @@ jobs:

- task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@2
displayName: 'Publish Security Analysis Logs'

- job: 'BuildPowerShellModule'
timeoutInMinutes: 120
dependsOn: 'Build'
condition: always()

steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download Build Artifacts'

- task: CopyFiles@2
displayName: 'Copy x64 PowerShell Binaries to Output'
inputs:
SourceFolder: '$(Pipeline.Workspace)\Build.x64release\PowerShell'
Contents: '**\*'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: CopyFiles@2
displayName: 'Copy x86 PowerShell Binaries to Output'
inputs:
SourceFolder: '$(Pipeline.Workspace)\Build.x86release\PowerShell'
Contents: '**\*'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PowerShell@2
displayName: 'Copy PowerShell Module Files to Output'
inputs:
filePath: 'src\PowerShell\Microsoft.WinGet.Client\Copy-ModuleFiles.ps1'
arguments: '-OutDir $(Build.ArtifactStagingDirectory)'

- task: PublishPipelineArtifact@1
displayName: Publish PowerShell Module Artifacts
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
54 changes: 45 additions & 9 deletions src/AppInstallerCLI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "COMServer", "COMServer\COMS
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Management.Deployment.InProc", "Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.InProc.vcxproj", "{9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Management.Deployment.Projection", "Microsoft.Management.Deployment.Projection\Microsoft.Management.Deployment.Projection.csproj", "{0B104762-5CD8-47EE-A904-71C1C3F84DCD}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PowerShell", "PowerShell", "{7C218A3E-9BC8-48FF-B91B-BCACD828C0C9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.WinGet.Client", "PowerShell\Microsoft.WinGet.Client\Microsoft.WinGet.Client.csproj", "{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Management.Deployment.Projection", "Microsoft.Management.Deployment.Projection\Microsoft.Management.Deployment.Projection.csproj", "{0B104762-5CD8-47EE-A904-71C1C3F84DCD}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UndockedRegFreeWinRT", "UndockedRegFreeWinRT\UndockedRegFreeWinRT\UndockedRegFreeWinRT.vcxproj", "{31ED69A8-5310-45A9-953F-56C351D2C3E1}"
EndProject
Expand Down Expand Up @@ -1032,6 +1036,37 @@ Global
{9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|x64.Build.0 = Release|x64
{9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|x86.ActiveCfg = Release|Win32
{9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|x86.Build.0 = Release|Win32
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Debug|Any CPU.ActiveCfg = Debug|ARM64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Debug|ARM.ActiveCfg = Debug|ARM64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Debug|ARM64.ActiveCfg = Debug|ARM64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Debug|ARM64.Build.0 = Debug|ARM64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Debug|x64.ActiveCfg = Debug|x64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Debug|x64.Build.0 = Debug|x64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Debug|x86.ActiveCfg = Debug|x86
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Debug|x86.Build.0 = Debug|x86
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Fuzzing|Any CPU.ActiveCfg = Debug|ARM64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Fuzzing|ARM.ActiveCfg = Debug|ARM64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Fuzzing|ARM64.ActiveCfg = Debug|ARM64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Fuzzing|ARM64.Build.0 = Debug|ARM64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Fuzzing|x64.ActiveCfg = Debug|x64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Fuzzing|x86.ActiveCfg = Debug|x86
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Fuzzing|x86.Build.0 = Debug|x86
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Release|Any CPU.ActiveCfg = Release|ARM64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Release|ARM.ActiveCfg = Release|ARM64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Release|ARM64.ActiveCfg = Release|ARM64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Release|ARM64.Build.0 = Release|ARM64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Release|x64.ActiveCfg = Release|x64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Release|x64.Build.0 = Release|x64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Release|x86.ActiveCfg = Release|x86
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.Release|x86.Build.0 = Release|x86
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.TestRelease|Any CPU.ActiveCfg = Debug|ARM64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.TestRelease|ARM.ActiveCfg = Debug|ARM64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.TestRelease|ARM64.ActiveCfg = Debug|ARM64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.TestRelease|ARM64.Build.0 = Debug|ARM64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.TestRelease|x64.ActiveCfg = Release|x64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.TestRelease|x64.Build.0 = Release|x64
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.TestRelease|x86.ActiveCfg = Debug|x86
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C}.TestRelease|x86.Build.0 = Debug|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|Any CPU.ActiveCfg = Debug|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|ARM.ActiveCfg = Debug|x86
{0B104762-5CD8-47EE-A904-71C1C3F84DCD}.Debug|ARM64.ActiveCfg = Debug|x86
Expand Down Expand Up @@ -1074,16 +1109,16 @@ Global
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|Any CPU.ActiveCfg = Debug|Win32
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|ARM.ActiveCfg = Debug|Win32
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|ARM64.ActiveCfg = Debug|Win32
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|x64.ActiveCfg = Debug|x64
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|x64.Build.0 = Debug|x64
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|x64.ActiveCfg = Release|x64
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|x64.Build.0 = Release|x64
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|x86.ActiveCfg = Debug|Win32
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|x86.Build.0 = Debug|Win32
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|Any CPU.ActiveCfg = Debug|Win32
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|Any CPU.Build.0 = Debug|Win32
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|ARM.ActiveCfg = Debug|Win32
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|ARM64.ActiveCfg = Debug|Win32
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|x64.ActiveCfg = Debug|x64
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|x64.Build.0 = Debug|x64
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|x64.ActiveCfg = Release|x64
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|x64.Build.0 = Release|x64
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|x86.ActiveCfg = Debug|Win32
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.TestRelease|x86.Build.0 = Debug|Win32
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Debug|Any CPU.ActiveCfg = Debug|Win32
Expand All @@ -1102,16 +1137,16 @@ Global
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Release|Any CPU.ActiveCfg = Debug|Win32
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Release|ARM.ActiveCfg = Debug|Win32
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Release|ARM64.ActiveCfg = Debug|Win32
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Release|x64.ActiveCfg = Debug|x64
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Release|x64.Build.0 = Debug|x64
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Release|x64.ActiveCfg = Release|x64
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Release|x64.Build.0 = Release|x64
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Release|x86.ActiveCfg = Debug|Win32
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.Release|x86.Build.0 = Debug|Win32
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|Any CPU.ActiveCfg = Debug|Win32
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|Any CPU.Build.0 = Debug|Win32
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|ARM.ActiveCfg = Debug|Win32
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|ARM64.ActiveCfg = Debug|Win32
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|x64.ActiveCfg = Debug|x64
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|x64.Build.0 = Debug|x64
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|x64.ActiveCfg = Release|x64
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|x64.Build.0 = Release|x64
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|x86.ActiveCfg = Debug|Win32
{787EC629-C0FB-4BA9-9746-4A82CD06B73E}.TestRelease|x86.Build.0 = Debug|Win32
EndGlobalSection
Expand All @@ -1133,6 +1168,7 @@ Global
{866C3F06-636F-4BE8-BC24-5F86ECC606A1} = {60618CAC-2995-4DF9-9914-45C6FC02C995}
{1A47951F-5C7A-4D6D-BB5F-D77484437940} = {8D53D749-D51C-46F8-A162-9371AAA6C2E7}
{409CD681-22A4-469D-88AE-CB5E4836E07A} = {8D53D749-D51C-46F8-A162-9371AAA6C2E7}
{463C0EF3-DF38-4C3D-8E7E-D4901E0CDC6C} = {7C218A3E-9BC8-48FF-B91B-BCACD828C0C9}
{31ED69A8-5310-45A9-953F-56C351D2C3E1} = {60618CAC-2995-4DF9-9914-45C6FC02C995}
{787EC629-C0FB-4BA9-9746-4A82CD06B73E} = {60618CAC-2995-4DF9-9914-45C6FC02C995}
EndGlobalSection
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// -----------------------------------------------------------------------------
// <copyright file="FindPackageCommand.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. Licensed under the MIT License.
// </copyright>
// -----------------------------------------------------------------------------

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

/// <summary>
/// Searches configured sources for packages.
/// </summary>
[Cmdlet(VerbsCommon.Find, Constants.PackageNoun)]
[OutputType(typeof(MatchResult))]
public sealed class FindPackageCommand : BaseFinderExtendedCommand
{
/// <summary>
/// Searches for configured sources for packages.
/// </summary>
protected override void ProcessRecord()
{
base.ProcessRecord();
var results = this.FindPackages(CompositeSearchBehavior.RemotePackagesFromRemoteCatalogs);
for (var i = 0; i < results.Count; i++)
{
this.WriteObject(results[i]);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// -----------------------------------------------------------------------------
// <copyright file="GetPackageCommand.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. Licensed under the MIT License.
// </copyright>
// -----------------------------------------------------------------------------

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

/// <summary>
/// Searches configured sources for packages.
/// </summary>
[Cmdlet(VerbsCommon.Get, Constants.PackageNoun)]
[OutputType(typeof(CatalogPackage))]
public sealed class GetPackageCommand : BaseFinderExtendedCommand
{
/// <summary>
/// Searches for configured sources for packages.
/// </summary>
protected override void ProcessRecord()
{
base.ProcessRecord();
var results = this.FindPackages(CompositeSearchBehavior.LocalCatalogs);
for (var i = 0; i < results.Count; i++)
{
this.WriteObject(results[i].CatalogPackage);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// -----------------------------------------------------------------------------
// <copyright file="GetSourceCommand.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. Licensed under the MIT License.
// </copyright>
// -----------------------------------------------------------------------------

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

/// <summary>
/// Retrieves the list of configured sources.
/// </summary>
[Cmdlet(VerbsCommon.Get, Constants.SourceNoun)]
[OutputType(typeof(PackageCatalogReference))]
public sealed class GetSourceCommand : BaseClientCommand
{
/// <summary>
/// Gets or sets the name of the source to retrieve.
/// </summary>
[Parameter(
Position = 0,
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true)]
public string Name { get; set; }

/// <summary>
/// Returns the list of configured sources.
/// </summary>
protected override void ProcessRecord()
{
base.ProcessRecord();
var results = GetPackageCatalogReferences(this.Name);
for (var i = 0; i < results.Count; i++)
{
this.WriteObject(results[i]);
}
}
}
}
Loading