xPSDesiredStateConfiguration icon indicating copy to clipboard operation
xPSDesiredStateConfiguration copied to clipboard

xWindowsPackageCab Logpath parameter should be handled properly in Set-TargetResource

Open Clebam opened this issue 1 year ago • 0 comments

Problem description

The Logpath parameter is not mandatory in set-targetresource : https://github.com/dsccommunity/xPSDesiredStateConfiguration/blob/main/source/DSCResources/DSC_xWindowsPackageCab/DSC_xWindowsPackageCab.psm1#L145

But is called anyway https://github.com/dsccommunity/xPSDesiredStateConfiguration/blob/main/source/DSCResources/DSC_xWindowsPackageCab/DSC_xWindowsPackageCab.psm1#L158

The same logic as in Get-TartgetResource should be applied : https://github.com/dsccommunity/xPSDesiredStateConfiguration/blob/main/source/DSCResources/DSC_xWindowsPackageCab/DSC_xWindowsPackageCab.psm1#L77

Verbose logs

You end up with a throw by DISM : dism\Add-WindowsPackage : DismInitialize failed. Error code = 0x80070057

DSC configuration

N/A

Suggested solution

The same logic as in Get-TartgetResource should be applied : https://github.com/dsccommunity/xPSDesiredStateConfiguration/blob/main/source/DSCResources/DSC_xWindowsPackageCab/DSC_xWindowsPackageCab.psm1#L77

Operating system the target node is running

Windows Server 2019

PowerShell version and build the target node is running

5.1

xPSDesiredStateConfiguration version

n/a

Clebam avatar Feb 12 '25 17:02 Clebam