Replies: 2 comments 1 reply
-
|
Hi can you run this with debug flag dsc --trace-level debug config |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
For DSC run try to change to PSscript: https://github.com/PowerShell/DSC/blob/main/dsc/examples/winps_script.dsc.yaml |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to automate the installation and configuration of Git. What I'd like to end up with is a config file that's shared with other platforms and a setup script for each.
Git is installed via WinGet, the resource installs fine under
winget configure. Since I've seen a couple of examples usingRunCommandOnSetI've already automated the installs of some portable programs. I also wanted to use this mechanism to install common Python libraries, but it just doesn't seem to be able to find the files relative to where I'm running winget from.My folder structure looks like:
With this as my initial WinGet configuration file:
Some of the things I've tried:
Changing to an absolute path obviously works, but it's not so good
${WinGetConfigRoot}variable doesn't seem to be resolved when used in the scriptBoth
$env:DSCConfigRootand$env:DSC_CONFIG_ROOTin the script seem to be empty (Need a way to reference file paths relative to the config file #75, RenameDSCConfigRootenvironment variable toDSC_CONFIG_ROOTand handle existing value #335)New-Itemscript and it created the file inC:\Also tried
pwsh -CommandWithArgsand passing another element (${WinGetConfigRoot}and$env:DSC_CONFIG_ROOT) in the argument list but that doesn't work eitherAlso tried using
PSDesiredStateConfiguration/Filewhere I copy the config toa known temporary location. Here
${WinGetConfigRoot}is resolved, but then I got this:Questions:
RunCommandOnSetknow where the config directory is?winget configurewas called from?${WinGetConfigRoot}orDSCConfigRoot/DSC_CONFIG_ROOTresolve underRunCommandOnSetresource?Fileresource? Can it not handle local paths or is it thinking it's remote because of the double backslashes?Other issues I've encountered which made debugging very difficult:
RunCommandSet, not in the console nor in the DiagOutputDir that would help me understand what the script is doing, where it fails, what it's current directory is, etc.Running DSC version: 3.1.2
WinGet: 1.12.350
OS: Windows 10 (21H1)
Powershell: 5.1.19041.906 / 7.5.4
Beta Was this translation helpful? Give feedback.
All reactions