-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Prerequisites
- Ensure you write a short, descriptive title after [Bug] above.
- Make sure to search for any existing issues before filing a new one.
- Verify you are able to reproduce the issue with the latest released version
PSAppDeployToolkit.Tools version
0.2.3
PSAppDeployToolkit version
4.0.5
Describe the bug
I did scroll through all issues, and I don't think there's any reports of this one. Excuse me if I'm mistaken.
I attempted converting a package and upon inspecting the results i noticed that splats weren't included in the converted command. Here's an example:
$InstallSplat = @{
Path = Join-Path $dirFiles -ChildPath "Setup.exe"
Parameters = "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /LOG=`"$($configToolkitLogDir)\$($appName)_$($appVersion)_install_exe.log`""
}
Execute-Process @InstallSplat
got converted to
$InstallSplat = @{
Path = Join-Path $adtSession.DirFiles -ChildPath "Setup.exe"
Parameters = "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /LOG=`"$(if ($isAdmin) { (Get-ADTConfig).Toolkit.LogPath } else { (Get-ADTConfig).Toolkit.LogPathNoAdminRights })\$($adtSession.AppName)_$($adtSession.AppVersion)_install_exe.log`""
}
Start-ADTProcess
As you can see there's actually two issues here:
- InstallSplat hashtable isn't added to the
Start-ADTProcess
command. - The variables within the splat aren't converted, as these should now be
FilePath
andArgumentList
.
I haven't dived much deeper into this, but VSCode quickly had me on alert as it warned me about unused variables. My team is heavily into splatting, so adding support for this would be much appreciated.
Also pretty gnarly conversion of the value for the Parameters variable :)
Steps to reproduce
Explained in description
Environment data
OsName : Microsoft Windows 11 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture : 64-biters
WindowsVersion : 2009
WindowsProductName : Windows 10 Enterprise
WindowsBuildLabEx : 22621.1.amd64fre.ni_release.220506-1250
OsLanguage : nb-NO
OsMuiLanguages : {nb-NO}
KeyboardLayout : nb-NO
TimeZone : (UTC+01:00) Amsterdam, Berlin, Bern, Oslo, Roma, Wien
HyperVisorPresent : True
CsPartOfDomain : False
CsPCSystemType : Mobile
dotnet: The term 'dotnet' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working