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

add license #53

Merged
merged 1 commit into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) Microsoft Corporation.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

param(
[switch]$Release,
[ValidateSet('none','aarch64-pc-windows-msvc','x86_64-pc-windows-msvc')]
Expand Down
27 changes: 16 additions & 11 deletions dsc/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# `config` command for using DSC resources
# `dsc` command for using DSC resources

## DESCRIPTION

The `config` command is used to discover and invoke DSC resources.
The `dsc` command is used to discover, invoke DSC resources, and apply configuration.

## Usage

Usage: config [subcommand] [options]
Subcommands:
list [filter] - list all resources, optional filter
get <resource> - invoke `get` on a resource
set <resource> - invoke `set` on a resource
test <resource> - invoke `test` on a resource
flushcache - flush the resource cache
Apply configuration or invoke specific DSC resources

Usage: dsc [OPTIONS] <COMMAND>

Commands:
config Apply a configuration document
resource Invoke a specific DSC resource
schema Get the JSON schema for a DSC type
help Print this message or the help of the given subcommand(s)

Options:
-h, --help
-n, --nocache - don't use the cache and force a new discovery
-n, --no-cache Whether to use the cache or not
-f, --format <FORMAT> [possible values: json, pretty-json, yaml]
-h, --help Print help
-V, --version Print version
82 changes: 41 additions & 41 deletions dsc/assertion.resource.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
{
"manifestVersion": "1.0",
"type": "DSC/AssertionGroup",
"version": "0.1.0",
"description": "`test` will be invoked for all resources in the supplied configuration.",
"get": {
"manifestVersion": "1.0",
"type": "DSC/AssertionGroup",
"version": "0.1.0",
"description": "`test` will be invoked for all resources in the supplied configuration.",
"get": {
"executable": "dsc",
"args": [
"config",
"test"
],
"input": "stdin"
},
"set": {
"executable": "dsc",
"args": [
"config",
"test"
],
"input": "stdin",
"preTest": true,
"return": "state"
},
"test": {
"executable": "dsc",
"args": [
"config",
"test"
],
"input": "stdin",
"return": "state"
},
"exitCodes": {
"0": "Success"
},
"schema": {
"command": {
"executable": "dsc",
"args": [
"config",
"test"
],
"input": "stdin"
},
"set": {
"executable": "dsc",
"args": [
"config",
"test"
],
"input": "stdin",
"preTest": true,
"return": "state"
},
"test": {
"executable": "dsc",
"args": [
"config",
"test"
],
"input": "stdin",
"return": "state"
},
"exitCodes": {
"0": "Success"
},
"schema": {
"command": {
"executable": "dsc",
"args": [
"schema",
"-t",
"configuration-and-resources"
]
}
"schema",
"-t",
"configuration-and-resources"
]
}
}
}
82 changes: 41 additions & 41 deletions dsc/group.resource.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
{
"manifestVersion": "1.0",
"type": "DSC/Group",
"version": "0.1.0",
"description": "All resources in the supplied configuration is treated as a group.",
"get": {
"manifestVersion": "1.0",
"type": "DSC/Group",
"version": "0.1.0",
"description": "All resources in the supplied configuration is treated as a group.",
"get": {
"executable": "dsc",
"args": [
"config",
"get"
],
"input": "stdin"
},
"set": {
"executable": "dsc",
"args": [
"config",
"set"
],
"input": "stdin",
"preTest": true,
"return": "state"
},
"test": {
"executable": "dsc",
"args": [
"config",
"test"
],
"input": "stdin",
"return": "state"
},
"exitCodes": {
"0": "Success"
},
"schema": {
"command": {
"executable": "dsc",
"args": [
"config",
"get"
],
"input": "stdin"
},
"set": {
"executable": "dsc",
"args": [
"config",
"set"
],
"input": "stdin",
"preTest": true,
"return": "state"
},
"test": {
"executable": "dsc",
"args": [
"config",
"test"
],
"input": "stdin",
"return": "state"
},
"exitCodes": {
"0": "Success"
},
"schema": {
"command": {
"executable": "dsc",
"args": [
"schema",
"-t",
"configuration-and-resources"
]
}
"schema",
"-t",
"configuration-and-resources"
]
}
}
}
88 changes: 44 additions & 44 deletions dsc/parallel.resource.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
{
"manifestVersion": "1.0",
"type": "DSC/ParallelGroup",
"version": "0.1.0",
"description": "All resources in the supplied configuration run concurrently.",
"get": {
"manifestVersion": "1.0",
"type": "DSC/ParallelGroup",
"version": "0.1.0",
"description": "All resources in the supplied configuration run concurrently.",
"get": {
"executable": "dsc",
"args": [
"config",
"--parallel",
"get"
],
"input": "stdin"
},
"set": {
"executable": "dsc",
"args": [
"config",
"--parallel",
"set"
],
"input": "stdin",
"preTest": true,
"return": "state"
},
"test": {
"executable": "dsc",
"args": [
"config",
"--parallel",
"test"
],
"input": "stdin",
"return": "state"
},
"exitCodes": {
"0": "Success"
},
"schema": {
"command": {
"executable": "dsc",
"args": [
"config",
"--parallel",
"get"
],
"input": "stdin"
},
"set": {
"executable": "dsc",
"args": [
"config",
"--parallel",
"set"
],
"input": "stdin",
"preTest": true,
"return": "state"
},
"test": {
"executable": "dsc",
"args": [
"config",
"--parallel",
"test"
],
"input": "stdin",
"return": "state"
},
"exitCodes": {
"0": "Success"
},
"schema": {
"command": {
"executable": "dsc",
"args": [
"schema",
"-t",
"configuration-and-resources"
]
}
"schema",
"-t",
"configuration-and-resources"
]
}
}
}
7 changes: 4 additions & 3 deletions dsc/src/args.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

use clap::{Parser, Subcommand, ValueEnum};

#[derive(Debug, Clone, PartialEq, Eq, ValueEnum)]
Expand All @@ -13,9 +16,7 @@ pub struct Args {
/// The subcommand to run
#[clap(subcommand)]
pub subcommand: SubCommand,
/// Whether to use the cache or not
#[clap(short = 'n', long)]
pub no_cache: bool,
/// The output format to use
#[clap(short = 'f', long)]
pub format: Option<OutputFormat>,
}
Expand Down
3 changes: 3 additions & 0 deletions dsc/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

use args::*;
use atty::Stream;
use clap::Parser;
Expand Down
3 changes: 3 additions & 0 deletions dsc/tests/dsc_args.tests.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

Describe 'config argument tests' {
It 'input is <type>' -Skip:(!$IsWindows) -TestCases @(
@{ type = 'yaml'; text = @'
Expand Down
3 changes: 3 additions & 0 deletions dsc/tests/dsc_config_get.tests.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

Describe 'dsc config get tests' {
It 'can successfully get config with multiple registry resource instances: <config>' -Skip:(!$IsWindows) -TestCases @(
@{ config = 'osinfo_registry.dsc.json' }
Expand Down
3 changes: 3 additions & 0 deletions dsc/tests/dsc_get.tests.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

Describe 'config get tests' {
It 'should get from registry using <type> resource' -Skip:(!$IsWindows) -TestCases @(
@{ type = 'string' }
Expand Down
3 changes: 3 additions & 0 deletions dsc/tests/dsc_schema.tests.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

Describe 'config schema tests' {
It 'return resource schema' -Skip:(!$IsWindows) {
$schema = dsc resource schema -r *registry
Expand Down
3 changes: 3 additions & 0 deletions dsc/tests/dsc_set.tests.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

Describe 'config set tests' {
BeforeEach {
$json = @'
Expand Down
Loading