Closed just1a-person closed 3 years ago
Yes, I agree. Will make this configurable for each provider and only require sudo if a used provider needs it.
Should be fixed in the next preview version. Now, either a resource provider can say that it needs administrative permissions, or you can opt-in for it when declaring the resource.
context.Resource<PowerShellScript>("Install Chocolatey")
.Script("~/install-chocolatey.ps1")
.RequireAdministrator()
.Unless("if (Test-Path \"$($env:ProgramData)/chocolatey/choco.exe\") { exit 1 }")
.After<RegistryKey>("Set execution policy")
.After<Download>("https://chocolatey.org/install.ps1");
Running as sudo in Linux shouldn't be required.