This repository was archived by the owner on Jun 14, 2024. It is now read-only.

Description
Summary of the new feature / enhancement
PackageManagementResource can install Winget and drive that, but it is nearly impossible to use meaningfully for two reasons:
1- winget install accepts a "--scope" parameter to let you specify whether the package is per-user or machine-wide, but PackageManager does not surface this,
2- attempting to instead pass the PSCredential of the user it should be installed as via PsDscRunAsCredential consistently produces an 0x80070520 error (no logon session) unless it is the credential of the current user anyway (which is thus pointless).
Proposed technical implementation details (optional)
Configuration InstallTerminal
{
Param([Parameter(Mandatory)][PSCredential] $UserCred)
PackageManager Winget
{
Name = 'WinGet'
Source = 'PSGallery'
}
PackageManager WindowsTerminal
{
DependsOn = '[PackageManager]Winget'
Ensure = 'Present'
Name = 'Microsoft.WindowsTerminal'
RequiredVersion = 'latest'
ProviderName = 'WinGet'
# New
Scope = 'LocalMachine' # vs PsDscRunAsCredential $UserCred -> 0x80070520
}
}