@@ -13,15 +13,40 @@ Generates a configuration document that defines the existing instances of a spec
13
13
14
14
## Syntax
15
15
16
+ ### Without instance properties
17
+
16
18
``` sh
17
19
dsc resource export [Options] --resource < RESOURCE>
18
20
```
19
21
22
+ ### Instance properties from input option
23
+
24
+ ``` sh
25
+ dsc resource export --input < INPUT> --resource < RESOURCE>
26
+ ```
27
+
28
+ ### Instance properties from file
29
+
30
+ ``` sh
31
+ dsc resource export --file < FILE> --resource < RESOURCE>
32
+ ```
33
+
34
+ ### Instance properties from stdin
35
+
36
+ ``` sh
37
+ cat < FILE> | dsc resource get [Options] --resource < RESOURCE> --file -
38
+ ```
39
+
20
40
## Description
21
41
22
42
The ` export ` subcommand generates a configuration document that includes every instance of a
23
43
specific resource. The resource must be specified with the ` --resource ` option.
24
44
45
+ Starting with DSC 3.1.0, You can use the ` --input ` or ` --file ` option to specify a resource
46
+ instance to use as a filter for the exported resources. When you do, the specified instance is
47
+ passed to the resource for use in filtering. The implementation for filtering depends on each
48
+ resource, not DSC itself.
49
+
25
50
Only specify exportable resources with a resource manifest that defines the [ export] [ 01 ] section in
26
51
the input configuration. If the specified resource type isn't exportable, DSC raises an error.
27
52
@@ -48,6 +73,48 @@ LongSyntax : --resource <RESOURCE>
48
73
ShortSyntax : -r <RESOURCE>
49
74
` ` `
50
75
76
+ ### -i, --input
77
+
78
+ <a id="-i"></a>
79
+ <a id="--input"></a>
80
+
81
+ Specifies the resource instance to use as a filter for exported resource instances.
82
+
83
+ The instance must be a string containing a JSON or YAML object. DSC validates the object against
84
+ the resource's instance schema. If the validation fails, DSC raises an error.
85
+
86
+ This option is mutually exclusive with the ` --file` option.
87
+
88
+ ` ` ` yaml
89
+ Type : string
90
+ Mandatory : false
91
+ LongSyntax : --input <INPUT>
92
+ ShortSyntax : -i <INPUT>
93
+ ` ` `
94
+
95
+ # ## -f, --file
96
+
97
+ <a id="-f"></a>
98
+ <a id="--file"></a>
99
+
100
+ Defines the path to a file defining the resource instance to use as a filter for exported resource
101
+ instances.
102
+
103
+ The specified file must contain a JSON or YAML object that represents valid properties for the
104
+ resource. DSC validates the object against the resource's instance schema. If the validation fails,
105
+ or if the specified file doesn't exist, DSC raises an error.
106
+
107
+ You can also use this option to pass an instance from stdin, as shown in [Example 3](#example-3).
108
+
109
+ This option is mutually exclusive with the `--input` option.
110
+
111
+ ` ` ` yaml
112
+ Type : string
113
+ Mandatory : false
114
+ LongSyntax : --file <FILE>
115
+ ShortSyntax : -f <FILE>
116
+ ` ` `
117
+
51
118
# ## -o, --output-format
52
119
53
120
<a id="-o"></a>
0 commit comments