Closed Trenly closed 6 days ago
[Policy] Issue Bug [Policy] Microsoft.VSCode.Dsc
If you want @Trenly , I can take a look into this?
Please do
I have both Insiders and Stable installed with user installation. I have tested it from my side, but both are working ...
The issue is these lines here: https://github.com/microsoft/winget-dsc/blob/73eabd2c55cb157d30f2420541c3bd7a6e8d68fa/resources/Microsoft.VSCode.Dsc/Microsoft.VSCode.Dsc.psm1#L98-L102
When an install fails, it may just returns a non-zero exit code instead of throwing an exception. This is what happened on my machine -
``` Setting 'VSCodeCLIPath' to 'C:\Users\Trenly\AppData\Local\Programs\Microsoft VS Code\bin\code.cmd' Running: & "C:\Users\Trenly\AppData\Local\Programs\Microsoft VS Code\bin\code.cmd" --list-extensions --show-versions Installed Extensions: Name Version ---- ------- eamodio.gitlens 15.6.3 mads-hartmann.bash-ide-vscode 1.43.0 ms-python.debugpy 2024.12.0 ms-python.python 2024.18.0 ms-python.vscode-pylance 2024.11.1 ms-vscode.powershell 2024.4.0 plorefice.devicetree 0.1.1 redhat.vscode-xml 0.27.1 redhat.vscode-yaml 1.15.0 'Set()' function was invoked 'Test()' function was invoked 'Get()' function was invokded Result of 'Get()': Name Version Exist Insiders ---- ------- ----- -------- EditorConfig.EditorConfig False False Desired State: Name Version Exist Insiders ---- ------- ----- -------- EditorConfig.EditorConfig True False Result of 'Test()': InDesiredState -------------- False System was not in desired state, continuing 'Install($false)' was invoked 'Install-VSCodeExtension' was invoked with parameters: Name: EditorConfig.EditorConfig Version: 'Get-VSCodeExtensionInstallArgument' was invoked with parameters: Name: EditorConfig.EditorConfig Version: Result of 'Get-VSCodeExtensionInstallArgument': EditorConfig.EditorConfig 'Invoke-VSCode' was invoked with parameters: Command: --install-extension EditorConfig.EditorConfig Invoking Expression: & "C:\Users\Trenly\AppData\Local\Programs\Microsoft VS Code\bin\code.cmd" --install-extension EditorConfig.EditorConfig Result of 'Invoke-VSCode': Installing extensions... self signed certificate in certificate chain Failed Installing Extensions: editorconfig.editorconfig Returned to 'Install-VSCodeExtension' Installed Extensions: Name Version ---- ------- eamodio.gitlens 15.6.3 mads-hartmann.bash-ide-vscode 1.43.0 ms-python.debugpy 2024.12.0 ms-python.python 2024.18.0 ms-python.vscode-pylance 2024.11.1 ms-vscode.powershell 2024.4.0 plorefice.devicetree 0.1.1 redhat.vscode-xml 0.27.1 redhat.vscode-yaml 1.15.0 Returned to 'Set()' Returned from DSC Resource ```
Brief description of your issue
Set()
indicates it was successful, but the extensions weren't installed. It only seems to be an issue for installing extensions, as removing them usingExist=$false
works. However, even explicitly settingExist=$true
doesn't affect the behaviorSteps to reproduce
Use the configuration file from #117 or run the commands manually -
Expected behavior
Extensions to be installed
Actual behavior
No Extensions :(
Environment
Running DSC resource directly