Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script crashes when used from DSC (PSDscResources/Script) through winget configure #2

Open
MarcoBuess opened this issue Dec 4, 2024 · 2 comments

Comments

@MarcoBuess
Copy link

MarcoBuess commented Dec 4, 2024

Hey! First of: Thanks for putting in the work, really apprechiate it. I had the installer running fine from a "normal" PSSession but am experiencing issues when running it through DSC when using winget configure. It crashes because it can not retrieve $__PSProfileEnvCommandLineArgs. I found the affected lines (473/474) but am not quite understanding what you're trying to accomplish there. Can you shed some light for me or have an idear how to fix this?

Thanks ❤️

@jpawlowski
Copy link
Owner

jpawlowski commented Dec 5, 2024

It seems these lines are leftovers that were not transformed correctly. I've fixed this in commit 9fbd9d6. Can you try it again? Note that the PowerShell Gallery version was not updated yet.

What the lines are generally doing is that the selection menu shall not appear when running the Nerd Font installation from a non-interactive PowerShell session that usually runs as part of an unattended setup (like with winget configure). In that situation, the font name parameter no longer is optional, but is a mandatory parameter as otherwise, no unattended setup is possible. I think this makes sense :-)

Monosnap   2024-12-05 14-02-05

@MarcoBuess
Copy link
Author

MarcoBuess commented Dec 6, 2024

I tried testing it and am now getting a PropertyNotFoundException: The property 'All' cannot be found on this object. Verify that the property exists.. In the meantime I wrote a 5 liner to do what I need. Its not as fancy but I guess it gets the job done. 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants