Git Product home page Git Product logo

cupboard's People

Contributors

antoniovalentini avatar blythmeister avatar codecyclone avatar jetersen avatar just1a-person avatar laurentkempe avatar patriksvensson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cupboard's Issues

Question: Will it support MacOs or Linux

Hello,

I've gone over the code and demo an i understand that in current state it does not support MacOs or Linux. Do you believe it should be included. If so when is it planed. Will you accept help with that?

Thank you

Power scheme provider

Think it would be useful to have a power scheme provider

we can either use P/Invoke directly or call powercfg.exe and parse the output.

Here is an example of P/Invoke for powrprof

I am already doing something in PowerShell (see below) but I want to be sure that state has not changed:

# Select Performance power scheme
$powerlist = powercfg /l
$performancePowerGuid = 
  $powerlist `
  | Select-String -Pattern "Power Scheme GUID: ([a-z0-9\-]+).+performance" `
  | Select-Object -First 1 | ForEach-Object {"$($_.matches.groups[1])"}

powercfg /setactive $performancePowerGuid

#Turn Off the display
Powercfg /Change monitor-timeout-ac 0
Powercfg /Change monitor-timeout-dc 0
Powercfg /Change standby-timeout-ac 0
Powercfg /Change standby-timeout-dc 0
Powercfg /Change disk-timeout-ac 0
Powercfg /Change disk-timeout-dc 0
Powercfg /Change hibernate-timeout-ac 0
Powercfg /Change hibernate-timeout-dc 0

# Disable battery saver
powercfg /setdcvalueindex SCHEME_CURRENT SUB_ENERGYSAVER ESBATTTHRESHOLD 0
powercfg /setdcvalueindex SCHEME_CURRENT SUB_ENERGYSAVER ESBRIGHTNESS 100

# Disable Hibernate
Powercfg /hibernate off

Cannot create registry key without value

There are some registry related things that depend on only having the key.

ie. HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Network\NewNetworkWindowOff

Currently this is not possible:

context.Resource<RegistryValue>("Disable New Network Popup")
    .Path(@"HKLM:\System\CurrentControlSet\Control\Network\NewNetworkWindowOff")
    .Ensure(RegistryKeyState.Exist);

As value is checked before making sure the path exist:

https://github.com/patriksvensson/cupboard/blob/e78c91af009089a331243010e7903689db17f028/src/Cupboard.Providers.Windows/Registry/RegistryValueProvider.cs#L50-L54

RegistryKeyProvider is marked obsolete and yet also checks for value.
https://github.com/patriksvensson/cupboard/blob/e78c91af009089a331243010e7903689db17f028/src/Cupboard.Providers.Windows/Registry/Obsolete/RegistryKeyProvider.cs#L50-L54

Windows Firewall Provider

Add support for Windows Firewall rules. Maybe based on the Windows Firewall Helper.

Rationale

Many application need to access resources over the network, like databases, Web- or E-Mail servers, and network folders. The application should be able to set the neccesary windows firewall rules itself - given the windows firewall is enabled. The rules should not apply on linux systems.

Support Reboot & Resume

When a chocolatey package requires a reboot have the option to let the reboot happen and then resume the setup process post reboot.

package provider cached output does not work well for chocolatey and winget

The cached output does not make sense when listing a specific package in GetPackageState

Basically the provider thinks only the first chocolatey package is installed.

We can either drop the cache or use a dictionary of some sort.
Dropping the cache means fixing it so that the vscode package provider perhaps list a specific extension.

I can work on a fix, I just need to hear what you would want as an solution :)

Could not load file or assembly Microsoft.Management.Infrastructure

Using the example to create a MVP i get

Could not load file or assembly 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
File name: 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
   at Cupboard.Internal.WmiFacts.GetFacts(IRemainingArguments args)+MoveNext()
   at Cupboard.Internal.FactBuilder.Build(IRemainingArguments args) in /_/src/Cupboard/Internal/FactBuilder.cs:line 20
   at Cupboard.Internal.ExecutionEngine.Run(IRemainingArguments args, IStatusUpdater status, Boolean dryRun) in /_/src/Cupboard/Internal/ExecutionEngine.cs:line 33
   at Cupboard.Internal.RunCommand.Run(CommandContext context, Settings settings) in /_/src/Cupboard/Internal/Cli/RunCommand.cs:line 135
   at Cupboard.Internal.RunCommand.Execute(CommandContext context, Settings settings) in /_/src/Cupboard/Internal/Cli/RunCommand.cs:line 105
   at Spectre.Console.Cli.Command`1.Spectre.Console.Cli.ICommand.Execute(CommandContext context, CommandSettings settings) in /_/src/Spectre.Console/Cli/CommandOfT.cs:line 44
   at Spectre.Console.Cli.CommandExecutor.Execute(CommandTree leaf, CommandTree tree, CommandContext context, ITypeResolver resolver, IConfiguration configuration) in /_/src/Spectre.Console/Cli/Internal/CommandExecutor.cs:line 115
   at Spectre.Console.Cli.CommandExecutor.Execute(IConfiguration configuration, IEnumerable`1 args) in /_/src/Spectre.Console/Cli/Internal/CommandExecutor.cs:line 84
   at Spectre.Console.Cli.CommandApp.RunAsync(IEnumerable`1 args) in /_/src/Spectre.Console/Cli/CommandApp.cs:line 87
   at Spectre.Console.Cli.CommandApp.Run(IEnumerable`1 args) in /_/src/Spectre.Console/Cli/CommandApp.cs:line 61
   at Spectre.Console.Cli.CommandApp`1.Run(IEnumerable`1 args) in /_/src/Spectre.Console/Cli/CommandAppOfT.cs:line 42
   at Cupboard.CupboardHost.Run(String[] args) in /_/src/Cupboard/CupboardHost.cs:line 30

I am running this on Windows. I've attached my csproj & 3 classes as they are tiny.
MachineSetup.zip

Add support for chocolatey flags

Add support for:

  • --prerelease (i like to be bold on some packages)
  • --ignore-checksum (the chrome package is notorious for a bad checksun)
  • --package-parameters (some packages like the visual studio & sql server packages require some extra parameters)

Compiler errors when following README

elo ๐Ÿ‘‹

I've stepped into some compiler errors while following the README and implementing the Chocolatey example.

If you say that I'm not missing anything and they can be fixed, I'd be more than happy to open a PR.

  • dotnet: 5.0
  • Cupboard: 0.4.0
  • OS: Windows

Missing closing curly bracket

The Chocolatey sealed class is missing a closing curly bracket at the very end.

Unable to check OSPlatform

The IF statement inside the MyWindowsComputer catalog example, is showing the error Cannot apply operator '!=' to operands of type 'Cupboard.Fact' and 'System.Runtime.InteropServices.OSPlatform'.

To fix it I have to access the Value property and cast it to OSPlatform:

if ((OSPlatform)context.Facts["os.platform"].Value != OSPlatform.Windows)
{
    return;
}

Missing Build function

I can't use the Run(string[] args) function after the AddCatalog<MyWindowsComputer>() one, during the CupboardHost builder creation.
To fix it, I have to call Build() and then Run(args):

return CupboardHost.CreateBuilder()
    .AddCatalog<MyWindowsComputer>()
    .Build()
    .Run(args);

Show plan as tree

I think it would be more useful to see the execution plan as a tree instead of a table.

Update to net6.0

We should probably remove net5.0 support in favor of net6.0 LTS.
This will also allow us to use new language features and make the code a bit neater.

@jetersen Any objections to this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.