Skip to content

Commit

Permalink
Support for PowerShell cmdlets in admin mode (#2642)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryfu-msft authored Dec 3, 2022
1 parent 114ce1e commit 8e30e7b
Show file tree
Hide file tree
Showing 37 changed files with 897 additions and 125 deletions.
20 changes: 20 additions & 0 deletions .github/actions/spelling/allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ aspnet
authn
authz
autocomplete
AUTOLISTEN
auxdata
azureedge
backend
Expand Down Expand Up @@ -202,6 +203,7 @@ hcertstore
HCRYPTMSG
hfile
HGLOBAL
HGlobal
HIDECANCEL
hinternet
HKCU
Expand All @@ -228,6 +230,7 @@ IDX
IFACEMETHOD
ifdef
ifndef
ifspec
ifstream
IIS
impl
Expand All @@ -246,9 +249,11 @@ INSTALLPATH
INSTALLUILEVEL
interop
INVALIDARG
INVALIDSID
iomanip
iostream
IPortable
ipmo
ISAPPROVEDFOROUTPUT
isspace
istream
Expand Down Expand Up @@ -311,13 +316,16 @@ msixmgr
msixsdk
msixsdkx
msixtest
MSHCTX
MSHLFLAGS
msrc
Multifile
Multimatch
mutex
mutexes
namespace
namespaces
ncacn
Nelon
netcoreapp
netstandard
Expand Down Expand Up @@ -395,18 +403,23 @@ preindexed
prepareforpackaging
PRIMARYKEY
prioritization
processthreadsapi
PRODUCTNAME
PRODUCTVERSION
PROGRAMFILES
PROGRESSONLY
promptrestart
PROPERTYDUMP
PROTSEQ
Protseq
psz
PTOKEN
ptr
publiccontainer
PUCHAR
PVOID
pwa
pwsh
QCol
RAII
rclsid
Expand Down Expand Up @@ -438,6 +451,7 @@ RESTSOURCE
resw
resx
rethrowing
REQS
roadmap
robuffer
rowcount
Expand Down Expand Up @@ -473,7 +487,9 @@ SHELLEXEC
SHELLEXECUTEINFO
SHELLEXECUTEINFOA
SHELLEXECUTEINFOW
shlobj
Shlwapi
shtypes
signtool
silentwithprogress
simplesave
Expand All @@ -497,6 +513,7 @@ src
srwlock
sscanf
sstream
STARTUPINFO
STATEACTION
STATFLAG
STATSTG
Expand Down Expand Up @@ -589,6 +606,7 @@ UIA
UIF
uint
Uknown
ULARGE
ulong
ULONGLONG
uncomment
Expand All @@ -598,6 +616,7 @@ unicode
UNICODESTRING
uninstall
uninstalling
Unmarshal
Unregister
Unregisters
untimes
Expand Down Expand Up @@ -669,6 +688,7 @@ WStr
wstring
wstringstream
WTD
wtypesbase
www
xamarin
xaml
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -329,3 +329,8 @@ ASALocalRun/

# MFractors (Xamarin productivity tool) working folder
.mfractor/

# Generated files from WinGetServer.idl
**/WinGetServer/WinGetServer.h
**/WinGetServer/WinGetServer_c.c
**/WinGetServer/WinGetServer_s.c
25 changes: 13 additions & 12 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,6 @@ jobs:
CleanTargetFolder: false
OverWrite: true

- template: templates/e2e-test.template.yml
parameters:
title: "E2E Tests Packaged"
isPackaged: true
filter: "TestCategory!=InProcess&TestCategory!=OutOfProcess"

- task: PowerShell@2
displayName: 'Set program files directory'
inputs:
Expand All @@ -238,12 +232,6 @@ jobs:
TargetFolder: '$(platformProgramFiles)\dotnet'
Contents: resources.pri

- template: templates/e2e-test.template.yml
parameters:
title: "COM API E2E Tests (In-process)"
isPackaged: false
filter: "TestCategory=InProcess"

# Winmd accessed by test runner process (dotnet.exe)
- task: CopyFiles@2
displayName: 'Copy winmd to dotnet directory'
Expand All @@ -260,6 +248,18 @@ jobs:
TargetFolder: 'src\AppInstallerCLIPackage\bin\$(buildPlatform)\$(buildConfiguration)'
Contents: Microsoft.Management.Deployment.winmd

- template: templates/e2e-test.template.yml
parameters:
title: "E2E Tests Packaged"
isPackaged: true
filter: "TestCategory!=InProcess&TestCategory!=OutOfProcess"

- template: templates/e2e-test.template.yml
parameters:
title: "COM API E2E Tests (In-process)"
isPackaged: false
filter: "TestCategory=InProcess"

- template: templates/e2e-test.template.yml
parameters:
title: "COM API E2E Tests (Out-of-process)"
Expand Down Expand Up @@ -305,6 +305,7 @@ jobs:
inputs:
filePath: 'src\PowerShell\Microsoft.WinGet.Client\Copy-PlatformBinaries.ps1'
arguments: '-Platform $(buildPlatform) -Configuration $(buildConfiguration) -OutDir $(artifactsDir)\PowerShell'
condition: always()

- task: PublishPipelineArtifact@1
displayName: Publish Pipeline Artifacts
Expand Down
7 changes: 5 additions & 2 deletions src/AppInstallerCLI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ 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", "Xlang\UndockedRegFreeWinRT\src\UndockedRegFreeWinRT\UndockedRegFreeWinRT\UndockedRegFreeWinRT.vcxproj", "{31ED69A8-5310-45A9-953F-56C351D2C3E1}"
ProjectSection(ProjectDependencies) = postProject
{2B00D362-AC92-41F3-A8D2-5B1599BDCA01} = {2B00D362-AC92-41F3-A8D2-5B1599BDCA01}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Detours", "Xlang\UndockedRegFreeWinRT\src\UndockedRegFreeWinRT\detours\detours.vcxproj", "{787EC629-C0FB-4BA9-9746-4A82CD06B73E}"
EndProject
Expand Down Expand Up @@ -992,8 +995,8 @@ Global
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|ARM64.ActiveCfg = Debug|Win32
{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}.Release|x86.ActiveCfg = Release|Win32
{31ED69A8-5310-45A9-953F-56C351D2C3E1}.Release|x86.Build.0 = Release|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
Expand Down
11 changes: 11 additions & 0 deletions src/AppInstallerCLIE2ETests/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class Constants
public const string MsiInstallerPathParameter = "MsiTestInstallerPath";
public const string MsixInstallerPathParameter = "MsixTestInstallerPath";
public const string PackageCertificatePathParameter = "PackageCertificatePath";
public const string PowerShellModulePathParameter = "PowerShellModulePath";
public const string AppInstallerTestCert = "AppInstallerTest.cer";
public const string AppInstallerTestCertThumbprint = "d03e7a688b388b1edde8476a627531c49db88017";

Expand Down Expand Up @@ -74,6 +75,16 @@ public class Constants
public const string TestExeUninstallerFileName = "UninstallTestExe.bat";
public const string TestExeUninstalledFileName = "TestExeUninstalled.txt";

// PowerShell Cmdlets
public const string FindCmdlet = "Find-WinGetPackage";
public const string GetCmdlet = "Get-WinGetPackage";
public const string GetSourceCmdlet = "Get-WinGetSource";
public const string InstallCmdlet = "Install-WinGetPackage";
public const string UninstallCmdlet = "Uninstall-WinGetPackage";
public const string UpdateCmdlet = "Update-WinGetPackage";

public const string WindowsPackageManagerServer = "WindowsPackageManagerServer";

// Locations
public const string LocalAppData = "LocalAppData";

Expand Down
Loading

0 comments on commit 8e30e7b

Please sign in to comment.