DestinationPath and SourcePath must both be accessible by the target Node.
Source |
|
DSC Resource |
|
Documentation |
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Mandatory |
Hashtable[] |
files and folders on the target node |
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
DestinationPath |
String |
The location on the target node |
||
Attributes |
String |
The desired state of the attributes for the targeted file or directory. |
|
|
Checksum |
String |
The checksum type to use when determining whether two files are the same. |
|
|
Contents |
String |
Indicates the contents to Ensure are Only valid when used with Type File. |
||
ContentFromFile |
String |
Loading contents from the specified file during DSC configuration build and append the loaded content to the Only valid when used with Type File. |
||
Credential |
PSCredential |
The credentials that are required to access resources, such as source files. |
||
Force |
Boolean |
Overrides access operations that would result in an error (such as overwriting a file or deleting a directory that is not empty). |
|
|
Recurse |
Boolean |
Only valid when used with Type Directory. Performs the state operation recursively to all directory content, subdirectories, and subdirectory content. |
|
|
SourcePath |
String |
The path from which to copy the file or folder resource. |
||
Type |
String |
The type of resource being configured. |
|
|
MatchSource |
Boolean |
Determines if the resource should monitor for new files added to the source directory after the initial copy. A value of |
|
|
Ensure |
String |
Determines whether the file and Contents at the Destination should exist or not. Set this property to `Present` to ensure the file exists. Set it to `Absent` to ensure they do not exist. |
|
|
Hashtable[] |
files and folders on the target node |
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Identity |
Key |
String |
The identity to set permissions for. |
|
Rights |
String[] |
The permissions to include in this rule. Optional if `Ensure` is set to value `Absent`. |
|
|
Ensure |
String |
Present to create the rule, Absent to remove an existing rule. |
|
|
ProcessOnlyOnActiveNode |
Boolean |
Specifies that the resource will only determine if a change is needed if the target node is the active host of the filesystem object. The user the configuration is run as must have permission to the Windows Server Failover Cluster. |
|
Note
|
If you do not specify a value for |
FilesAndFolders:
Items:
- DestinationPath: C:\Test.txt
Contents: Test Content
Ensure: Present
Force: true
Type: File
- DestinationPath: C:\Script_FromMOF.ps1
ContentFromFile: .\DscConfigData\Roles\MyScriptCode.ps1
Ensure: Present
Force: true
Type: File
- DestinationPath: C:\Test
Ensure: Present
Force: true
Recurse: true
SourcePath: C:\Source
Type: Directory
- DestinationPath: C:\TestShare
Ensure: Present
Force: true
Type: Directory
Permissions:
- Identity: Administrators
Rights: FullControl
- Identity: Users
Rights:
- Read
- Write
- ExecuteFile