Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- xPackage
- Uninstalling software (Ensure = Absent) did not work due to improper handling of arguments. This fixes #704.

### Fixed

- xPSDesiredStateConfiguration
Expand Down
17 changes: 3 additions & 14 deletions source/DSCResources/DSC_xPackageResource/DSC_xPackageResource.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -539,19 +539,8 @@ function Set-TargetResource
else
{
# Absent case
$startInfo.FileName = "$env:winDir\system32\msiexec.exe"

# We may have used the Name earlier, now we need the actual ID
if ($null -eq $productEntry -or $null -eq $productEntry.Name)
{
$id = $Path
}
else
{
$id = Split-Path -Path $productEntry.Name -Leaf
}

$startInfo.Arguments = "/x `"$id`" /quiet /norestart"
$uninstallString = $productEntry.GetValue('UninstallString')
$startInfo.FileName = $uninstallString

if ($LogPath)
{
Expand All @@ -561,7 +550,7 @@ function Set-TargetResource
if ($Arguments)
{
# Append the specified arguments with a space (#195)
$startInfo.Arguments += ' {0}' -f $Arguments
$startInfo.Arguments = " $Arguments"
}
}
}
Expand Down