dsccommunity/xPSDesiredStateConfiguration

xPackage arguments missing a space

Closed this issue · 8 comments

xPackage is missing a space before the string in the Arguments parameter.

Example DSC that used to work:

xPackage InstallAccessDataBaseEngine_x64
{
    Name = 'Microsoft Access database engine 2010 (English)'
    Ensure = 'Present'
    Path = 'C:\Install\AceRedist.msi'
    ProductId = '90140000-00D1-0409-1000-0000000FF1CE'
    Arguments = '/quiet /norestart'
    ReturnCode = @(
        '0',
        '3010'
    )
}

Logged:

[[xPackage]InstallAccessDataBaseEngine_x64] Starting
C:\Windows\system32\msiexec.exe with /i "C:\Install\AceRedist.msi" /quiet/quiet /norestart
VERBOSE: [97561A4CD997]:
[[xPackage]InstallAccessDataBaseEngine_x64] Starting process C:\Windows\system32\msiexec.exe with arguments /i "C:\Install\AceRedist.msi" /quiet/quiet /norestart

process info showing the missing space

PS C:> gwmi win32_process -filter "name = 'msiexec.exe'" | Select-Object CommandLine

CommandLine

"C:\Windows\system32\msiexec.exe" /i "C:\Install\AceRedist.msi" /quiet/quiet /norestart

Also wanted to add that I'm working around this for now by adding a leading space in my argument list.

@tehsuk - thanks for raising the issue! I'm working on this resource at the moment so I'll include a fix for this too.

@PlagueHO, just wondering if you had some time to resolve the issue?

Hi @Zuldan, I just needed to submit a PR to fix the pssa errors on the resource. This would then allow me to begin addressing the other issues on it. I'll get going on this after work tonight! Won't take long

@PlagueHO, thank you so much! I've got a dirty hack to get it working for the time being. Looking forward to the full fix. Maybe there should be some sort of Pester test to check parameters are formatted correctly?

This is a bit cheeky of me...but I'm wondering if you would consider adding a feature to xDisk (dsccommunity/StorageDsc#47). I'm wanting to use it in conjunction with ciSCSI and configuring SQL Servers.

@Zuldan: I found a relatively 'clean' hack is to put a leading space in the argument list.

eg: replace:
Arguments = '/quiet /norestart'
with
Arguments = ' /quiet /norestart'

This should work even after the bug is fixed.

@Zuldan @tehsuk I'm working on this issue now and, looking through the code of the current (5.0.0.0) release, the /quiet parameter is automatically passed for MSI packages. You can see this here: https://github.com/PowerShell/xPSDesiredStateConfiguration/blob/dev/DSCResources/MSFT_xPackageResource/MSFT_xPackageResource.psm1#L1282.

The /NoRestart argument is missing and I'll add this in. This should be in by default as we need to restrict the ability to reboot to the LCM.

@iainbrighton thanks for the update. Every time a new version xPSDesiredStateConfiguration is released I have to change...

$startInfo.Arguments += " /quiet"

to...

$startInfo.Arguments += " /quiet "

so that xPackage doesn't get stuck. Really annoying. Probably my fault for not learning how to do a PR.