microsoft / microsoft/winget-cli

Machine Configuration and Software Package

Open
#4,222 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

DSC-Resource Issue-Bug
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Brief description of your issue

I have a created a Machine Configuration Policy using the PowerShell DSC Module Microsoft.WinGet.DSC and deployed it to an Azure Arc Enabled Server with the Windows Server Insider Version 26063 which has winget installed. I receive the following Issue "PowerShell DSC resource Microsoft.WinGet.DSC failed to execute Set functionality with error message: WinGetPackage Failed installing Microsoft.PowerShell. InstallStatus 'NoApplicableInstallers' InstallerErrorCode '0' ExtendedError '-1978335216'
The SendConfigurationApply function did not succeed. LCM failed to start desired state configuration manually."

Steps to reproduce
  1. Onboard a Windows Server Insider 26063 to Azure Arc
  2. Create a DSC File and convert it to a Machine Configuration using the following COmmands: `Configuration PowerShell7
{
    Import-DscResource -ModuleName Microsoft.WinGet.DSC

    node localhost
    {
        WinGetPackage PowerShell7
        {
            Id = 'Microsoft.PowerShell'
            source = 'winget'
            InstallMode = 'silent'
        }
    }
}

PowerShell7

New-GuestConfigurationPackage -Configuration powershell7\localhost.mof -Name WinGet_PowerShell7 -Type AuditAndSet 


$existingAccountParams = @{
    ResourceGroupname = 'rg-machineconfiguration-mgt-dev-szn-01'
    Name              = 'stsimgtdevsznmachineconf'
}

$container = Get-AzStorageAccount @existingAccountParams |
Get-AzStorageContainer -Name machineconfiguration 


$setParams = @{
    Container = 'machineconfiguration'
    File      = '.\WinGet_PowerShell7.zip'
    Context   = $container.Context
}

$blob = Set-AzStorageBlobContent @setParams
$contentUri = $blob.ICloudBlob.Uri.AbsoluteUri

$PolicyConfig      = @{
    PolicyId      = (New-Guid)
    ContentUri    = $contentUri
    DisplayName   = 'WinGet_PowerShell7'
    Description   = 'Install PowerShell 7 using WinGet'
    Path          = './WinGet_PowerShell7'
    Platform      = 'Windows'
    PolicyVersion = '1.0.0'
    Mode          = 'ApplyAndAutoCorrect'
  }
  
  New-GuestConfigurationPolicy @PolicyConfig

  New-AzPolicyDefinition -Name 'Winget_PowerShell7' -Policy 

WinGet_PowerShell7\WinGet_PowerShell7_DeployIfNotExists.json
`

Expected behavior

Expected behavior that it would install the defined Package on the Azure Arc Enabled Server.

Actual behavior

image

The Policy appears multiple Times

Environment
Windows: Windows.Server v10.0.26063.1
Systemarchitektur: X64
Paket: Microsoft.DesktopAppInstaller v1.22.10582.0

WinGet-Verzeichnisse
-----------------------------------------------------------------------------------------------------------------------
Protokolle                                   %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\Local…
Benutzereinstellungen                        %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\Local…
Verzeichnis für portierbare Links (Benutzer) %LOCALAPPDATA%\Microsoft\WinGet\Links
Portables Linkverzeichnis (Computer)         C:\Program Files\WinGet\Links
Portierbarer Paketstamm (Benutzer)           %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portierbarer Paketstamm                      C:\Program Files\WinGet\Packages
Portierbares Paketstamm (x86)                C:\Program Files (x86)\WinGet\Packages
Installationsprogrammdownloads               %USERPROFILE%\Downloads

Links
-----------------------------------------------------------------------------------------
Datenschutzerklärung              https://aka.ms/winget-privacy
Lizenzvereinbarung                https://aka.ms/winget-license
Hinweise von Drittanbietern       https://aka.ms/winget-3rdPartyNotice
Startseite                        https://aka.ms/winget
Windows Store-Nutzungsbedingungen https://www.microsoft.com/en-us/storedocs/terms-of-sale

Administratoreinstellung                  Status
-----------------------------------------------------
LocalManifestFiles                        Deaktiviert
BypassCertificatePinningForMicrosoftStore Deaktiviert
InstallerHashOverride                     Deaktiviert
LocalArchiveMalwareScanOverride           Deaktiviert

Edited by @denelon to add formatting in markdown.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Microsoft.WinGet.DSC WinGetPackage configuration on Windows Server 26063 and inspect the NoApplicableInstallers failure. Review the generated WinGet_PowerShell7_DeployIfNotExists.json and the Azure Arc machine-configuration application path. Done means Microsoft.PowerShell installs successfully and the policy applies without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cli, cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.