diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index 9fabfde..15ce8e3 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -35,6 +35,61 @@ "redirect_url": "/powershell/dsc/overview", "redirect_document_id": false }, + { + "source_path": "dsc/docs-conceptual/dsc-1.1/getting-started/lnxGettingStarted.md", + "redirect_url": "/powershell/dsc/reference/resources/linux", + "redirect_document_id": false + }, + { + "source_path": "dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxArchiveResource.md", + "redirect_url": "/powershell/dsc/reference/resources/linux", + "redirect_document_id": false + }, + { + "source_path": "dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxEnvironmentResource.md", + "redirect_url": "/powershell/dsc/reference/resources/linux", + "redirect_document_id": false + }, + { + "source_path": "dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxFileLineResource.md", + "redirect_url": "/powershell/dsc/reference/resources/linux", + "redirect_document_id": false + }, + { + "source_path": "dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxFileResource.md", + "redirect_url": "/powershell/dsc/reference/resources/linux", + "redirect_document_id": false + }, + { + "source_path": "dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxGroupResource.md", + "redirect_url": "/powershell/dsc/reference/resources/linux", + "redirect_document_id": false + }, + { + "source_path": "dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxPackageResource.md", + "redirect_url": "/powershell/dsc/reference/resources/linux", + "redirect_document_id": false + }, + { + "source_path": "dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxScriptResource.md", + "redirect_url": "/powershell/dsc/reference/resources/linux", + "redirect_document_id": false + }, + { + "source_path": "dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxServiceResource.md", + "redirect_url": "/powershell/dsc/reference/resources/linux", + "redirect_document_id": false + }, + { + "source_path": "dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxSshAuthorizedKeysResource.md", + "redirect_url": "/powershell/dsc/reference/resources/linux", + "redirect_document_id": false + }, + { + "source_path": "dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxUserResource.md", + "redirect_url": "/powershell/dsc/reference/resources/linux", + "redirect_document_id": false + }, { "source_path": "dsc/docs-conceptual/dsc-2.0/concepts/terminology.md", "redirect_url": "/powershell/dsc/concepts/glossary?view=dsc-2.0", diff --git a/dsc/docfx.json b/dsc/docfx.json index 1b90a7e..2ebcefc 100644 --- a/dsc/docfx.json +++ b/dsc/docfx.json @@ -45,7 +45,7 @@ "dsc-3.0/**/*.yml": "cmdlets" }, "ms.topic": { - "docs-conceptual/**": "conceptual", + "docs-conceptual/**": "concept-article", "docs-conceptual/**/getting-started/**": "get-started", "docs-conceptual/**/get-started/**": "get-started", "docs-conceptual/**/how-tos/**": "how-to", @@ -55,11 +55,15 @@ "docs-conceptual/**/troubleshooting/**": "troubleshooting", "docs-conceptual/**/tutorials/**": "tutorial", "dsc-1.1/PSDesiredStateConfiguration/*": "reference", - "dsc-1.1/PSDesiredStateConfiguration/About/*.md": "conceptual", + "dsc-1.1/PSDesiredStateConfiguration/About/*.md": "concept-article", "dsc-2.0/PSDesiredStateConfiguration/*": "reference", - "dsc-2.0/PSDesiredStateConfiguration/About/*.md": "conceptual", + "dsc-2.0/PSDesiredStateConfiguration/About/*.md": "concept-article", "dsc-3.0/PSDesiredStateConfiguration/*": "reference", - "dsc-3.0/PSDesiredStateConfiguration/About/*.md": "conceptual" + "dsc-3.0/PSDesiredStateConfiguration/About/*.md": "concept-article" + }, + "ms.update-cycle": { + "dsc-1.1/**": "3650-days", + "dsc-2.0/**": "1825-days" } }, "globalMetadata": { diff --git a/dsc/docs-conceptual/dsc-1.1/getting-started/lnxGettingStarted.md b/dsc/docs-conceptual/dsc-1.1/getting-started/lnxGettingStarted.md deleted file mode 100644 index 8c45506..0000000 --- a/dsc/docs-conceptual/dsc-1.1/getting-started/lnxGettingStarted.md +++ /dev/null @@ -1,227 +0,0 @@ ---- -ms.date: 03/09/2024 -keywords: dsc,powershell,configuration,setup -title: Get started with Desired State Configuration (DSC) for Linux -description: This topic explains how to get started using PowerShell Desired State Configuration (DSC) for Linux. ---- -# Get started with Desired State Configuration (DSC) for Linux - -This topic explains how to get started using PowerShell Desired State Configuration (DSC) for Linux. -For general information about DSC, see -[Get Started with Windows PowerShell Desired State Configuration](../overview.md). - -## Supported Linux operation system versions - -The following Linux operating system versions are supported by DSC for Linux. - -- CentOS 7, and 8 (x64) -- Debian GNU/Linux 8, 9, and 10 (x64) -- Oracle Linux 7 (x64) -- Red Hat Enterprise Linux Server 7, and 8 (x64) -- SUSE Linux Enterprise Server 12 and 15 (x64) -- Ubuntu Server 14.04 LTS, 16.04 LTS, 18.04 LTS, and 20.04 LTS (x64) - -## Installing DSC for Linux - -You must install the [Open Management Infrastructure (OMI)](https://github.com/Microsoft/omi) before -installing DSC for Linux. - -### Installing OMI - -Desired State Configuration for Linux requires the Open Management Infrastructure (OMI) CIM server, -version 1.0.8.1 or later. OMI can be downloaded from The Open Group: -[Open Management Infrastructure (OMI)](https://github.com/Microsoft/omi). - -To install OMI, install the package that is appropriate for your Linux system (.rpm or .deb) and -OpenSSL version (ssl_098 or ssl_100), and architecture (x64/x86). RPM packages are appropriate for -CentOS, Red Hat Enterprise Linux, SUSE Linux Enterprise Server, and Oracle Linux. DEB packages are -appropriate for Debian GNU/Linux and Ubuntu Server. The ssl_098 packages are appropriate for -computers with OpenSSL 0.9.8 installed while the ssl_100 packages are appropriate for computers with -OpenSSL 1.0 installed. - -> [!NOTE] -> To determine the installed OpenSSL version, run the command `openssl version`. - -Run the following command to install OMI on a CentOS 7 x64 system. - -`# sudo rpm -Uvh omiserver-1.0.8.ssl_100.rpm` - -### Installing DSC - -DSC for Linux is available for download from the -[PowerShell-DSC-for-Linux](https://github.com/Microsoft/PowerShell-DSC-for-Linux/releases/tag/v1.2.1-0) -repository in the repository. - -To install DSC, install the package that is appropriate for your Linux system (.rpm or .deb), -OpenSSL version, and architecture (x64/x86). RPM packages are appropriate for CentOS, Red Hat -Enterprise Linux, SUSE Linux Enterprise Server, and Oracle Linux. DEB packages are appropriate -for Debian GNU/Linux and Ubuntu Server. - -> [!NOTE] -> Support for DSC Linux OpenSSL up to version 1.1. To determine the installed OpenSSL version, -> run the command `openssl version`. - -Run the following command to install DSC on a CentOS 7 x64 system. - -`# sudo rpm -Uvh dsc-1.0.0-254.ssl_100.x64.rpm` - -## Using DSC for Linux - -The following sections explain how to create and run DSC configurations on Linux computers. - -### Creating a configuration MOF document - -The Windows PowerShell Configuration keyword is used to create a configuration for Linux computers, -just like for Windows computers. The following steps describe the creation of a configuration -document for a Linux computer using Windows PowerShell. - -1. Import the nx module. The nx Windows PowerShell module contains the schema for Built-In resources - for DSC for Linux, and must be installed to your local computer and imported in the - configuration. - - - To install the nx module, copy the nx module directory to either - `$env:USERPROFILE\Documents\WindowsPowerShell\Modules\` or `$PSHOME\Modules`. The nx module is - included in the DSC for Linux installation package. To import the nx module in your - configuration, use the `Import-DSCResource` command: - - ```powershell - Configuration ExampleConfiguration{ - - Import-DSCResource -ModuleName nx - - } - ``` - -2. Define a configuration and generate the configuration document: - - ```powershell - Configuration ExampleConfiguration - { - Import-DSCResource -ModuleName nx - - Node "linuxhost.contoso.com" - { - nxFile ExampleFile - { - DestinationPath = "/tmp/example" - Contents = "hello world `n" - Ensure = "Present" - Type = "File" - } - } - } - - ExampleConfiguration -OutputPath:"C:\temp" - ``` - -### Push the configuration to the Linux computer - -Configuration documents (MOF files) can be pushed to the Linux computer using the -[Start-DscConfiguration](/powershell/module/psdesiredstateconfiguration/start-dscconfiguration) -cmdlet. In order to use this cmdlet, along with the -[Get-DscConfiguration](/powershell/module/PSDesiredStateConfiguration/Get-DscConfiguration), or -[Test-DscConfiguration](/powershell/module/psdesiredstateconfiguration/Test-DSCConfiguration) -cmdlets, remotely to a Linux computer, you must use a CIMSession. The -[New-CimSession](/powershell/module/CimCmdlets/New-CimSession) cmdlet is used to create a -**CIMSession** to the Linux computer. - -The following code shows how to create a CIMSession for DSC for Linux. - -```powershell -$Node = "ostc-dsc-01" -$Credential = Get-Credential -UserName "root" -Message "Enter Password:" - -#Ignore SSL certificate validation -# $opt = New-CimSessionOption -UseSsl -SkipCACheck -SkipCNCheck -SkipRevocationCheck - -#Options for a trusted SSL certificate -$opt = New-CimSessionOption -UseSsl - -$sessParams = @{ - Credential = $credential - ComputerName = $Node - Port = 5986 - Authentication = 'basic' - SessionOption = $opt - OperationTimeoutSec = 90 -} - -$Sess = New-CimSession @sessParams -``` - -> [!NOTE] -> For "Push" mode, the user credential must be the root user on the Linux computer. Only SSL/TLS -> connections are supported for DSC for Linux, the `New-CimSession` must be used with the –UseSSL -> parameter set to $true. The SSL certificate used by OMI (for DSC) is specified in the file: -> `/etc/opt/omi/conf/omiserver.conf` with the properties: pemfile and keyfile. If this certificate -> is not trusted by the Windows computer that you are running the -> [New-CimSession](/powershell/module/CimCmdlets/New-CimSession) cmdlet on, you can choose to ignore -> certificate validation with the CIMSession Options: -> `-SkipCACheck -SkipCNCheck -SkipRevocationCheck` - -Run the following command to push the DSC configuration to the Linux node. - -`Start-DscConfiguration -Path:"C:\temp" -CimSession $Sess -Wait -Verbose` - -### Distribute the configuration with a pull server - -Configurations can be distributed to a Linux computer with a pull server, just like for Windows -computers. For guidance on using a pull server, see -[Windows PowerShell Desired State Configuration Pull Servers](../pull-server/pullServer.md). For -additional information and limitations related to using Linux computers with a pull server, see the -Release Notes for Desired State Configuration for Linux. - -### Working with configurations locally - -DSC for Linux includes scripts to work with configuration from the local Linux computer. These -scripts are locate in `/opt/microsoft/dsc/Scripts` and include the following: - -- GetDscConfiguration.py - - Returns the current configuration applied to the computer. Similar to the Windows PowerShell cmdlet - `Get-DscConfiguration` cmdlet. - - `# sudo ./GetDscConfiguration.py` - -- GetDscLocalConfigurationManager.py - - Returns the current meta-configuration applied to the computer. Similar to the cmdlet [Get-DSCLocalConfigurationManager](/powershell/module/PSDesiredStateConfiguration/Get-DscLocalConfigurationManager) cmdlet. - - `# sudo ./GetDscLocalConfigurationManager.py` - -- InstallModule.py - - Installs a custom DSC resource module. Requires the path to a .zip file containing the module shared object library and schema MOF files. - - `# sudo ./InstallModule.py /tmp/cnx_Resource.zip` - -- RemoveModule.py - - Removes a custom DSC resource module. Requires the name of the module to remove. - - `# sudo ./RemoveModule.py cnx_Resource` - -- StartDscLocalConfigurationManager.py - - Applies a configuration MOF file to the computer. Similar to the - [Start-DscConfiguration](/powershell/module/psdesiredstateconfiguration/start-dscconfiguration) - cmdlet. Requires the path to the configuration MOF to apply. - - `# sudo ./StartDscLocalConfigurationManager.py –configurationmof /tmp/localhost.mof` - -- SetDscLocalConfigurationManager.py - - Applies a Meta Configuration MOF file to the computer. Similar to the - [Set-DSCLocalConfigurationManager](/powershell/module/PSDesiredStateConfiguration/Set-DscLocalConfigurationManager) - cmdlet. Requires the path to the Meta Configuration MOF to apply. - - `# sudo ./SetDscLocalConfigurationManager.py –configurationmof /tmp/localhost.meta.mof` - -## PowerShell Desired State Configuration for Linux Log Files - -The following log files are generated for DSC for Linux messages. - -| Log file | Directory | Description | -| ----------------- | ------------------ | -------------------------------------------------------------------------------------------------------- | -| **omiserver.log** | `/var/opt/omi/log` | Messages relating to the operation of the OMI CIM server. | -| **dsc.log** | `/var/opt/omi/log` | Messages relating to the operation of the Local Configuration Manager (LCM) and DSC resource operations. | diff --git a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/index.md b/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/index.md new file mode 100644 index 0000000..2636a0d --- /dev/null +++ b/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/index.md @@ -0,0 +1,29 @@ +--- +ms.date: 10/23/2025 +ms.topic: reference +title: DSC for Linux Resources +description: DSC for Linux Resources +--- + +# DSC for Linux Resources + +DSC for Linux is no longer supported. The [PowerShell DSC for Linux project][01] was deprecated and +archived on 12 September 2024. On 30 September 2023, Microsoft retired the desired state +configuration (DSC) extension for Linux virtual machines and support for Linux machines in Azure +Automation DSC. The [OMI project][02] has been deprecated since 24 March 2025. + +You can continue to use PowerShell DSC resources on Linux through the following tools: + +- [Azure machine configuration][03] +- [Microsoft desired state configuration][04] + +You can continue to use updated versions of the resources previously provided by PowerShell DSC for +Linux with the [nxtools module][05], which is [available on the PowerShell Gallery][06]. + + +[01]: https://github.com/microsoft/PowerShell-DSC-for-Linux +[02]: https://github.com/microsoft/omi +[03]: /azure/governance/machine-configuration/overview +[04]: ../../../overview.md?view=dsc-3.0&preserve-view=true +[05]: https://github.com/azure/nxtools +[06]: https://www.powershellgallery.com/packages/nxtools/1.6.0 diff --git a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxArchiveResource.md b/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxArchiveResource.md deleted file mode 100644 index aaa1693..0000000 --- a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxArchiveResource.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -ms.date: 03/09/2024 -ms.topic: reference -title: DSC for Linux nxArchive Resource -description: DSC for Linux nxArchive Resource ---- -# DSC for Linux nxArchive Resource - -The **nxArchive** resource in PowerShell Desired State Configuration (DSC) provides a mechanism to -unpack archive (.tar, .zip) files at a specific path on a Linux node. - -## Syntax - -```Syntax -nxArchive #ResourceName -{ - SourcePath = - DestinationPath = - [ Checksum = { ctime | mtime | md5 } ] - [ Force = ] - [ DependsOn = ] - [ Ensure = { Absent | Present } ] -} -``` - -## Properties - -|Property |Description | -|---|---| -|SourcePath |Specifies the source path of the archive file. This should be a .tar, .zip, or .tar.gz file. | -|DestinationPath |Specifies the location where you want to ensure the archive contents are extracted. | -|Checksum |Defines the type to use when determining whether the source archive has been updated. Values are: **ctime**, **mtime**, or **md5**. The default value is **md5**. | -|Force |Certain file operations (such as overwriting a file or deleting a directory that is not empty) will result in an error. Using the **Force** property overrides such errors. The default value is `$false`. | - -## Common properties - -|Property |Description | -|---|---| -|DependsOn |Indicates that the configuration of another resource must run before this resource is configured. For example, if the ID of the resource configuration script block that you want to run first is ResourceName and its type is ResourceType, the syntax for using this property is `DependsOn = "[ResourceType]ResourceName"`. | -|Ensure |Determines whether to check if the content of the archive exists at the **Destination**. Set this property to **Present** to ensure the contents exist. Set it to **Absent** to ensure they do not exist. The default value is **Present**. | - -## Example - -The following example shows how to use the **nxArchive** resource to ensure that the contents of an -archive file called `website.tar` exist and are extracted at a given destination. - -```powershell -Import-DSCResource -ModuleName nx - -nxFile SyncArchiveFromWeb -{ - Ensure = "Present" - SourcePath = "http://release.contoso.com/releases/website.tar" - DestinationPath = "/usr/release/staging/website.tar" - Type = "File" - Checksum = "mtime" -} - -nxArchive SyncWebDir -{ - SourcePath = "/usr/release/staging/website.tar" - DestinationPath = "/usr/local/apache2/htdocs/" - Force = $false - DependsOn = "[nxFile]SyncArchiveFromWeb" -} -``` diff --git a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxEnvironmentResource.md b/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxEnvironmentResource.md deleted file mode 100644 index b50b427..0000000 --- a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxEnvironmentResource.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -ms.date: 03/09/2024 -ms.topic: reference -title: DSC for Linux nxEnvironment Resource -description: DSC for Linux nxEnvironment Resource ---- -# DSC for Linux nxEnvironment Resource - -The **nxEnvironment** resource in PowerShell Desired State Configuration (DSC) provides a mechanism -to manage system environment variables on a Linux node. - -## Syntax - -```Syntax -nxEnvironment #ResourceName -{ - Name = - [ Value = - [ Path = } - [ DependsOn = ] - [ Ensure = { Absent | Present } ] -} -``` - -## Properties - -|Property |Description | -|---|---| -|Name |Indicates the name of the environment variable for which you want to ensure a specific state. | -|Value |The value to assign to the environment variable. | -|Path |Defines the environment variable that is being configured. Set this property to `$true` if the variable is the **Path** variable; otherwise, set it to `$false`. The default is `$false`. If the variable being configured is the **Path** variable, the value provided through the **Value** property will be appended to the existing value. | - -## Common properties - -|Property |Description | -|---|---| -|DependsOn |Indicates that the configuration of another resource must run before this resource is configured. For example, if the ID of the resource configuration script block that you want to run first is ResourceName and its type is ResourceType, the syntax for using this property is `DependsOn = "[ResourceType]ResourceName"`. | -|Ensure |Determines whether to check if the variable exists. Set this property to **Present** to ensure the variable exists. Set it to **Absent** to ensure the variable does not exist. The default value is **Present**. | - -## Additional Information - -- If **Path** is absent or set to `$false`, environment variables are managed in `/etc/environment`. - Your programs or scripts may require configuration to source the `/etc/environment` file to access - the managed environment variables. -- If **Path** is set to `$true`, the environment variable is managed in the file - `/etc/profile.d/DSCenvironment.sh`. This file will be created if it does not exist. If **Ensure** - is set to **Absent** and **Path** is set to `$true`, an existing environment variable will only be - removed from `/etc/profile.d/DSCenvironment.sh` and not from other files. - -## Example - -The following example shows how to use the **nxEnvironment** resource to ensure that -**TestEnvironmentVariable** is present and has the value "Test-Value". If -**TestEnvironmentVariable** is not present, it will be created. - -```powershell -Import-DSCResource -ModuleName nx - -nxEnvironment EnvironmentExample -{ - Ensure = "Present" - Name = "TestEnvironmentVariable" - Value = "TestValue" -} -``` diff --git a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxFileLineResource.md b/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxFileLineResource.md deleted file mode 100644 index bcd197c..0000000 --- a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxFileLineResource.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -ms.date: 03/09/2024 -ms.topic: reference -title: DSC for Linux nxFileLine Resource -description: DSC for Linux nxFileLine Resource ---- -# DSC for Linux nxFileLine Resource - -The **nxFileLine** resource in PowerShell Desired State Configuration (DSC) provides a mechanism to -manage lines within a configuration file on a Linux node. - -## Syntax - -```Syntax -nxFileLine #ResourceName -{ - FilePath = - ContainsLine = - [ DoesNotContainPattern = ] - [ DependsOn = ] -} -``` - -## Properties - -|Property |Description | -|---|---| -|FilePath |The full path to the file to manage lines in on the target node. | -|ContainsLine |A line to ensure exists in the file. This line will be appended to the file if it does not exist in the file. **ContainsLine** is mandatory, but can be set to an empty string (`ContainsLine = ""`) if it is not needed. | -|DoesNotContainPattern |A regular expression pattern for lines that should not exist in the file. For any lines that exist in the file that match this regular expression, the line will be removed from the file. | - -## Common properties - -|Property |Description | -|---|---| -|DependsOn |Indicates that the configuration of another resource must run before this resource is configured. For example, if the ID of the resource configuration script block that you want to run first is ResourceName and its type is ResourceType, the syntax for using this property is `DependsOn = "[ResourceType]ResourceName"`. | - -## Example - -This example demonstrates using the **nxFileLine** resource to configure the `/etc/sudoers` file, -ensuring that the user: monuser is configured to not requiretty. - -```powershell -Import-DSCResource -ModuleName nx - -nxFileLine DoNotRequireTTY -{ - FilePath = "/etc/sudoers" - ContainsLine = 'Defaults:monuser !requiretty' - DoesNotContainPattern = "Defaults:monuser[ ]+requiretty" -} -``` diff --git a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxFileResource.md b/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxFileResource.md deleted file mode 100644 index fb0335d..0000000 --- a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxFileResource.md +++ /dev/null @@ -1,163 +0,0 @@ ---- -ms.date: 03/09/2024 -ms.topic: reference -title: DSC for Linux nxFile Resource -description: DSC for Linux nxFile Resource ---- -# DSC for Linux nxFile Resource - -The **nxFile** resource in PowerShell Desired State Configuration (DSC) provides a mechanism to -manage files and directories on a Linux node. - -## Syntax - -```Syntax -nxFile #ResourceName -{ - DestinationPath = - [ SourcePath = ] - [ Type = { directory | file | link } ] - [ Contents = ] - [ Checksum = { ctime | mtime | md5 } ] - [ Recurse = ] - [ Force = ] - [ Links = { follow | manage | ignore } ] - [ Group = ] - [ Mode = ] - [ Owner = ] - [ DependsOn = ] - [ Ensure = { Absent | Present } ] -} -``` - -## Properties - -|Property |Description | -|---|---| -|DestinationPath |Specifies the location where you want to ensure the state for a file or directory. | -|SourcePath |Specifies the path from which to copy the file or folder resource. This path may be a local path, or an `http/https/ftp` URL. Remote `http/https/ftp` URLs are only supported when the value of the **Type** property is **file**. | -|Type |Specifies whether the resource being configured is a directory or a file. Set this property to **directory** to indicate that the resource is a directory. Set it to **file** to indicate that the resource is a file. The default value is **file**. | -|Contents |Specifies the contents of a file, such as a particular string. | -|Checksum |Defines the type to use when determining whether two files are the same. If **Checksum** is not specified, only the file or directory name is used for comparison. Values are: **ctime**, **mtime**, or **md5**. | -|Recurse |Indicates if subdirectories are included. Set this property to `$true` to indicate that you want subdirectories to be included. The default is `$false`. This property is only valid when the **Type** property is set to **directory**. | -|Force |Certain file operations (such as overwriting a file or deleting a directory that is not empty) will result in an error. Using the **Force** property overrides such errors. The default value is `$false`. | -|Links |Specifies the desired behavior for symbolic links. Set this property to **follow** to follow symbolic links and act on the links target. For example, copy the file instead of the link. Set this property to **manage** to act on the link. For example, copy the link itself. Set this property to **ignore** to ignore symbolic links. | -|Group |The name of the **Group** to have permissions to the file or directory. | -|Mode |Specifies the desired permissions for the resource, in octal or symbolic notation. For example, **777** or **rwxrwxrwx**. If using symbolic notation, do not provide the first character which indicates directory or file. | -|Owner |The name of the group to own the file or directory. | - -## Common properties - -|Property |Description | -|---|---| -|DependsOn |Indicates that the configuration of another resource must run before this resource is configured. For example, if the ID of the resource configuration script block that you want to run first is ResourceName and its type is ResourceType, the syntax for using this property is `DependsOn = "[ResourceType]ResourceName"`. | -|Ensure |Determines whether to check if the file exists. Set this property to **Present** to ensure the file exists. Set it to **Absent** to ensure the file does not exist. The default value is **Present**. | - -## Additional Information - -Linux and Windows use different line break characters in text files by default, and this can cause -unexpected results when configuring some files on a Linux computer with **nxFile**. There are -multiple ways to manage the content of a Linux file while avoiding issues caused by unexpected line -break characters: - -1. Copy the file from a remote source (http, https, or ftp) - - Create a file on Linux with the desired contents, and stage it on a web or ftp server accessible - the node(s) you will configure. Define the **SourcePath** property in the **nxFile** resource - with the web or ftp URL to the file. - - ```powershell - Import-DSCResource -ModuleName nx - - Node $Node - { - nxFile resolvConf - { - SourcePath = "http://10.185.85.11/conf/resolv.conf" - DestinationPath = "/etc/resolv.conf" - Mode = "644" - Type = "file" - } - } - ``` - -1. Read the file contents in the PowerShell script with - [Get-Content](xref:Microsoft.PowerShell.Management.Get-Content) after setting the **$OFS** - property to use the Linux line-break character. - - ```powershell - Import-DSCResource -ModuleName nx - - Node $Node - { - $OFS = "`n" - $Contents = Get-Content C:\temp\resolv.conf - - nxFile resolvConf - { - DestinationPath = "/etc/resolv.conf" - Mode = "644" - Type = "file" - Contents = "$Contents" - } - } - ``` - -1. Use a PowerShell function to replace Windows line breaks with Linux line-break characters. - - ```powershell - Function LinuxString($inputStr){ - $outputStr = $inputStr.Replace("`r`n","`n") - $outputStr += "`n" - Return $outputStr - } - - Import-DSCResource -ModuleName nx - - Node $Node - { - $Contents = @' - search contoso.com - domain contoso.com - nameserver 10.185.85.11 - '@ - $Contents = LinuxString $Contents - - nxFile resolvConf - { - DestinationPath = "/etc/resolv.conf" - Mode = "644" - Type = "file" - Contents = $Contents - } - } - ``` - -## Example - -The following example ensures that the directory `/opt/mydir` exists, and that a file with specified -contents exists this directory. - -```powershell -Import-DSCResource -ModuleName nx - -Node $node { - nxFile DirectoryExample - { - Ensure = "Present" - DestinationPath = "/opt/mydir" - Type = "Directory" - } - - nxFile FileExample - { - Ensure = "Present" - Destinationpath = "/opt/mydir/myfile" - Contents=@" -#!/bin/bash`necho "hello world"`n -"@ - Mode = "755" - DependsOn = "[nxFile]DirectoryExample" - } -} -``` diff --git a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxGroupResource.md b/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxGroupResource.md deleted file mode 100644 index cd91b90..0000000 --- a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxGroupResource.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -ms.date: 03/09/2024 -ms.topic: reference -title: DSC for Linux nxGroup Resource -description: DSC for Linux nxGroup Resource ---- -# DSC for Linux nxGroup Resource - -The **nxGroup** resource in PowerShell Desired State Configuration (DSC) provides a mechanism to -manage local groups on a Linux node. - -## Syntax - -```Syntax -nxGroup #ResourceName -{ - GroupName = - [ Members = ] - [ MembersToInclude = ] - [ MembersToExclude = ] - [ PreferredGroupID = ] - [ DependsOn = ] - [ Ensure = { Absent | Present } ] -} -``` - -## Properties - -|Property |Description | -|---|---| -|GroupName |Specifies the name of the group for which you want to ensure a specific state. | -|Members |Specifies the members that form the group. | -|MembersToInclude |Specifies the users who you want to ensure are members of the group. | -|MembersToExclude |Specifies the users who you want to ensure are not members of the group. | -|PreferredGroupID |Sets the group id to the provided value if possible. If the group id is currently in use, the next available group id is used. | - -## Common properties - -|Property |Description | -|---|---| -|DependsOn |Indicates that the configuration of another resource must run before this resource is configured. For example, if the ID of the resource configuration script block that you want to run first is ResourceName and its type is ResourceType, the syntax for using this property is `DependsOn = "[ResourceType]ResourceName"`. | -|Ensure |Determines whether to check if the group exists. Set this property to **Present** to ensure the group exists. Set it to **Absent** to ensure the group does not exist. The default value is **Present**. | - -## Example - -The following example ensures that the user 'monuser' exists and is a member of the group 'DBusers'. - -```powershell -Import-DSCResource -ModuleName nx - -Node $node -{ - nxUser UserExample { - UserName = 'monuser' - Description = 'Monitoring user' - Password = '$6$fZAne/Qc$MZejMrOxDK0ogv9SLiBP5J5qZFBvXLnDu8HY1Oy7ycX.Y3C7mGPUfeQy3A82ev3zIabhDQnj2ayeuGn02CqE/0' - Ensure = 'Present' - HomeDirectory = '/home/monuser' - } - - nxGroup GroupExample { - GroupName = 'DBusers' - Ensure = 'Present' - MembersToInclude = 'monuser' - DependsOn = '[nxUser]UserExample' - } -} -``` diff --git a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxPackageResource.md b/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxPackageResource.md deleted file mode 100644 index 6a14724..0000000 --- a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxPackageResource.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -ms.date: 03/09/2024 -ms.topic: reference -title: DSC for Linux nxPackage Resource -description: DSC for Linux nxPackage Resource ---- -# DSC for Linux nxPackage Resource - -The **nxPackage** resource in PowerShell Desired State Configuration (DSC) provides a mechanism to -manage packages on a Linux node. - -## Syntax - -```Syntax -nxPackage #ResourceName -{ - Name = - [ PackageManager = { Yum | Apt | Zypper } ] - [ PackageGroup = ] - [ Arguments = ] - [ ReturnCode = ] - [ FilePath = ] - [ DependsOn = ] - [ Ensure = { Absent | Present } ] -} -``` - -## Properties - -|Property |Description | -|---|---| -|Name |The name of the package for which you want to ensure a specific state. | -|PackageManager |Supported values are **yum**, **apt**, and **zypper**. Specifies the package manager to use when installing packages. If **FilePath** is specified, the provided path will be used to install the package. Otherwise, a Package Manager will be used to install the package from a pre-configured repository. If neither **PackageManager** nor **FilePath** are provided, the default package manager for the system will be used. | -|PackageGroup |If `$true`, the **Name** is expected to be the name of a package group for use with a **PackageManager**. **PackageGroup** is not valid when providing a **FilePath**. | -|Arguments |A string of arguments that will be passed to the package exactly as provided. | -|ReturnCode |The expected return code. If the actual return code does not match the expected value provided here, the configuration will return an error. | -|FilePath |The file path where the package resides. | - -## Common properties - -|Property |Description | -|---|---| -|DependsOn |Indicates that the configuration of another resource must run before this resource is configured. For example, if the ID of the resource configuration script block that you want to run first is ResourceName and its type is ResourceType, the syntax for using this property is `DependsOn = "[ResourceType]ResourceName"`. | -|Ensure |Determines whether to check if the package exists. Set this property to **Present** to ensure the package exists. Set it to **Absent** to ensure the package does not exist. The default value is **Present**. | - -## Example - -The following example ensures that the package named "httpd" is installed on a Linux computer, using -the "Yum" package manager. - -```powershell -Import-DSCResource -ModuleName nx - -Node $node -{ - nxPackage httpd - { - Name = "httpd" - Ensure = "Present" - PackageManager = "Yum" - } -} -``` diff --git a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxScriptResource.md b/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxScriptResource.md deleted file mode 100644 index f9ec626..0000000 --- a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxScriptResource.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -ms.date: 03/09/2024 -ms.topic: reference -title: DSC for Linux nxScript Resource -description: DSC for Linux nxScript Resource ---- -# DSC for Linux nxScript Resource - -The **nxScript** resource in PowerShell Desired State Configuration (DSC) provides a mechanism to -run Linux scripts on a Linux node. - -## Syntax - -```Syntax -nxScript #ResourceName -{ - GetScript = - SetScript = - TestScript = - [ User = ] - [ Group = ] - [ DependsOn = ] -} -``` - -## Properties - -|Property |Description | -|---|---| -|GetScript |Provides a script to return current status of the machine. This script runs when you invoke the [GetDscConfiguration.py](https://github.com/Microsoft/PowerShell-DSC-for-Linux#performing-dsc-operations-from-the-linux-computer) script. The script must begin with a shebang, such as `#!/bin/bash`. | -|SetScript |Provides a script that puts the machine in the correct state. When you invoke the [StartDscConfiguration.py](https://github.com/Microsoft/PowerShell-DSC-for-Linux#performing-dsc-operations-from-the-linux-computer) script, the **TestScript** runs first. If the **TestScript** block returns an exit code other than 0, the **SetScript** block will run. If the **TestScript** returns an exit code of 0, the **SetScript** will not run. The script must begin with a shebang, such as `#!/bin/bash`. | -|TestScript |Provides a script that evaluates whether the node is currently in the correct state. When you invoke the [StartDscConfiguration.py](https://github.com/Microsoft/PowerShell-DSC-for-Linux#performing-dsc-operations-from-the-linux-computer) script, this script runs. If it returns an exit code other than 0, the **SetScript** will run. If it returns an exit code of 0, the **SetScript** will not run. The **TestScript** also runs when you invoke the [TestDscConfiguration](https://github.com/Microsoft/PowerShell-DSC-for-Linux#performing-dsc-operations-from-the-linux-computer) script. However, in this case, the **SetScript** will not run, no matter what exit code is returned from the **TestScript**. The **TestScript** must contain content and must return an exit code of 0 if the actual configuration matches the current desired state configuration, and an exit code other than 0 if it does not match. The current desired state configuration is the last configuration enacted on the node that is using DSC. The script must begin with a shebang, such as `#!/bin/bash`. | -|User |The user to run the script as. | -|Group |The group to run the script as. | - -## Common properties - -|Property |Description | -|---|---| -|DependsOn |Indicates that the configuration of another resource must run before this resource is configured. For example, if the ID of the resource configuration script block that you want to run first is ResourceName and its type is ResourceType, the syntax for using this property is `DependsOn = "[ResourceType]ResourceName"`. | - -## Example - -The following example demonstrates the use of the **nxScript** resource to perform additional -configuration management. - -```powershell -Import-DSCResource -ModuleName nx - -Node $node -{ - nxScript KeepDirEmpty { - - GetScript = @" -#!/bin/bash -ls /tmp/mydir/ | wc -l -"@ - - SetScript = @" -#!/bin/bash -rm -rf /tmp/mydir/* -"@ - - TestScript = @' -#!/bin/bash -filecount=`ls /tmp/mydir | wc -l` -if [ $filecount -gt 0 ] -then - exit 1 -else - exit 0 -fi -'@ - } -} -``` diff --git a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxServiceResource.md b/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxServiceResource.md deleted file mode 100644 index da5c2b6..0000000 --- a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxServiceResource.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -ms.date: 03/09/2024 -ms.topic: reference -title: DSC for Linux nxService Resource -description: DSC for Linux nxService Resource ---- -# DSC for Linux nxService Resource - -The **nxService** resource in PowerShell Desired State Configuration (DSC) provides a mechanism to -manage services on a Linux node. - -## Syntax - -```Syntax -nxService #ResourceName -{ - Name = - [ Controller = { init | upstart | systemd } ] - [ Enabled = ] - [ State = { Running | Stopped } ] - [ DependsOn = ] -} -``` - -## Properties - -|Property |Description | -|---|---| -|Name |The name of the service/daemon to configure. | -|Controller |The type of service controller to use when configuring the service. | -|Enabled |Indicates whether the service starts on boot. | -|State |Indicates whether the service is running. Set this property to **Stopped** to ensure that the service is not running. Set it to **Running** to ensure that the service is running. | - -## Common properties - -|Property |Description | -|---|---| -|DependsOn |Indicates that the configuration of another resource must run before this resource is configured. For example, if the ID of the resource configuration script block that you want to run first is ResourceName and its type is ResourceType, the syntax for using this property is `DependsOn = "[ResourceType]ResourceName"`. | - -## Additional Information - -The **nxService** resource will not create a service definition or script for the service if it does -not exist. You can use the PowerShell Desired State Configuration **nxFile** Resource resource to -manage the existence or contents of the service definition file or script. - -## Example - -The following example shows configuration of the 'httpd' service (for Apache HTTP Server), -registered with the **SystemD** service controller. - -```powershell -Import-DSCResource -ModuleName nx - -Node $node -{ - #Apache Service - nxService ApacheService { - Name = 'httpd' - State = 'running' - Enabled = $true - Controller = 'systemd' - } -} -``` diff --git a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxSshAuthorizedKeysResource.md b/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxSshAuthorizedKeysResource.md deleted file mode 100644 index bf0ab94..0000000 --- a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxSshAuthorizedKeysResource.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -ms.date: 03/09/2024 -ms.topic: reference -title: DSC for Linux nxSshAuthorizedKeys Resource -description: DSC for Linux nxSshAuthorizedKeys Resource ---- -# DSC for Linux nxSshAuthorizedKeys Resource - -The **nxAuthorizedKeys** resource in PowerShell Desired State Configuration (DSC) provides a -mechanism to manage authorized ssh keys for a specified user. - -## Syntax - -```Syntax -nxAuthorizedKeys #ResourceName -{ - KeyComment = - [ Username = ] - [ Key = ] - [ DependsOn = ] - [ Ensure = { Absent | Present } ] -} -``` - -## Properties - -|Property |Description | -|---|---| -|KeyComment |A unique comment for the key. This is used to uniquely identify keys. | -|Username |The username to manage ssh authorized keys for. If not defined, the default user is **root**. | -|Key |The contents of the key. This is required if **Ensure** is set to **Present**.| - -## Common properties - -|Property |Description | -|---|---| -|DependsOn |Indicates that the configuration of another resource must run before this resource is configured. For example, if the ID of the resource configuration script block that you want to run first is ResourceName and its type is ResourceType, the syntax for using this property is `DependsOn = "[ResourceType]ResourceName"`. | -|Ensure |Specifies whether the key is defined. Set this property to **Absent** to ensure the key does not exist in the user's authorized keys file. Set it to **Present** to ensure the key is defined in the user's authorized key file. | - -## Example - -The following example defines a public ssh authorized key for the user "monuser". - -```powershell -Import-DSCResource -ModuleName nx - -Node $node -{ - nxSshAuthorizedKeys myKey - { - KeyComment = "myKey" - Ensure = "Present" - Key = 'ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA0b+0xSd07QXRifm3FXj7Pn/DblA6QI5VAkDm6OivFzj3U6qGD1VJ6AAxWPCyMl/qhtpRtxZJDu/TxD8AyZNgc8aN2CljN1hOMbBRvH2q5QPf/nCnnJRaGsrxIqZjyZdYo9ZEEzjZUuMDM5HI1LA9B99k/K6PK2Bc1NLivpu7nbtVG2tLOQs+GefsnHuetsRMwo/+c3LtwYm9M0XfkGjYVCLO4CoFuSQpvX6AB3TedUy6NZ0iuxC0kRGg1rIQTwSRcw+McLhslF0drs33fw6tYdzlLBnnzimShMuiDWiT37WqCRovRGYrGCaEFGTG2e0CN8Co8nryXkyWc6NSDNpMzw== rsa-key-20150401' - UserName = "monuser" - } -} -``` diff --git a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxUserResource.md b/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxUserResource.md deleted file mode 100644 index 5258f57..0000000 --- a/dsc/docs-conceptual/dsc-1.1/reference/resources/linux/lnxUserResource.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -ms.date: 03/09/2024 -ms.topic: reference -title: DSC for Linux nxUser Resource -description: DSC for Linux nxUser Resource ---- -# DSC for Linux nxUser Resource - -The **nxUser** resource in PowerShell Desired State Configuration (DSC) provides a mechanism to -manage local users on a Linux node. - -## Syntax - -```Syntax -nxUser #ResourceName -{ - UserName = - [ FullName = ] - [ Description = ] - [ Password = ] - [ Disabled = ] - [ PasswordChangeRequired = ] - [ HomeDirectory = ] - [ GroupID = ] - [ DependsOn = ] - [ Ensure = { Absent | Present } ] -} -``` - -## Properties - -|Property |Indicates the account name for which you want to ensure a specific state. | -|---|---| -|UserName |Specifies the location where you want to ensure the state for a file or directory. | -|FullName |A string that contains the full name to use for the user account. | -|Description |The description for the user account. | -|Password |The hash of the users password in the appropriate form for the Linux computer. Typically, this is a salted SHA-256, or SHA-512 hash. On Debian and Ubuntu Linux, this value can be generated with the `mkpasswd` command. For other Linux distros, the crypt method of Python's Crypt library can be used to generate the hash. | -|Disabled |Indicates whether the account is enabled. Set this property to `$true` to ensure that this account is disabled, and set it to `$false` to ensure that it is enabled. | -|PasswordChangeRequired |Indicates whether the user can change the password. Set this property to `$true` to ensure that the user cannot change the password, and set it to `$false` to allow the user to change the password. The default value is `$false`. This property is only evaluated if the user account did not exist previously and is being created. | -|HomeDirectory |The home directory for the user. | -|GroupID |The primary group ID for the user. | - -## Common properties - -|Property |Description | -|---|---| -|DependsOn |Indicates that the configuration of another resource must run before this resource is configured. For example, if the ID of the resource configuration script block that you want to run first is ResourceName and its type is ResourceType, the syntax for using this property is `DependsOn = "[ResourceType]ResourceName"`. | -|Ensure |Specifies whether the account exists. Set this property to **Present** to ensure that the account exists, and set it to **Absent** to ensure that the account does not exist. | - -## Example - -The following example ensures that the user "monuser" exists and is a member of the group "DBusers". - -```powershell -Import-DSCResource -ModuleName nx - -Node $node -{ - nxUser UserExample{ - UserName = "monuser" - Description = "Monitoring user" - Password = '$6$fZAne/Qc$MZejMrOxDK0ogv9SLiBP5J5qZFBvXLnDu8HY1Oy7ycX.Y3C7mGPUfeQy3A82ev3zIabhDQnj2ayeuGn02CqE/0' - Ensure = "Present" - HomeDirectory = "/home/monuser" - } - - nxGroup GroupExample{ - GroupName = "DBusers" - Ensure = "Present" - MembersToInclude = "monuser" - DependsOn = "[nxUser]UserExample" - } -} -``` diff --git a/dsc/docs-conceptual/dsc-1.1/resources/resources.md b/dsc/docs-conceptual/dsc-1.1/resources/resources.md index e1b0948..3ac6fa2 100644 --- a/dsc/docs-conceptual/dsc-1.1/resources/resources.md +++ b/dsc/docs-conceptual/dsc-1.1/resources/resources.md @@ -1,5 +1,5 @@ --- -ms.date: 07/23/2020 +ms.date: 10/23/2025 keywords: dsc,powershell,configuration,setup title: DSC Resources description: DSC resources provide the building blocks for a DSC configuration. A resource exposes properties that can be configured (schema) and contains the PowerShell script functions used by the LCM to apply the configuration. @@ -21,24 +21,20 @@ structure that is portable and includes metadata to identify how the resources a used. Each resource has a *schema that determines the syntax needed to use the resource in a -[Configuration](../configurations/configurations.md). A resource's schema can be defined in the -following ways: +[Configuration][02]. A resource's schema can be defined in the following ways: - `Schema.Mof` file: Most resources define their _schema_ in a `schema.mof` file, using - [Managed Object Format](/windows/desktop/wmisdk/managed-object-format--mof-). -- `.schema.psm1` file: [Composite Resources](../configurations/compositeConfigs.md) - define their _schema_ in a `.schema.psm1` file using a - [Parameter Block](/powershell/module/microsoft.powershell.core/about/about_functions#functions-with-parameters). + [Managed Object Format][34]. +- `.schema.psm1` file: [Composite Resources][01] define their _schema_ in a + `.schema.psm1` file using a [Parameter Block][30]. - `.psm1` file: Class based DSC resources define their _schema_ in the class definition. Syntax items are denoted as Class properties. For more information, see - [about_Classes](/powershell/module/psdesiredstateconfiguration/about/about_classes_and_dsc). + [about_Classes][32]. -To retrieve the syntax for a DSC resource, use the -[Get-DSCResource](/powershell/module/PSDesiredStateConfiguration/Get-DscResource) cmdlet with the -**Syntax** parameter. This usage is similar to using -[Get-Command](/powershell/module/microsoft.powershell.core/get-command) with the **Syntax** -parameter to get cmdlet syntax. The output you see will show the template used for a resource block -for the resource you specify. +To retrieve the syntax for a DSC resource, use the [Get-DSCResource][33] cmdlet with the **Syntax** +parameter. This usage is similar to using [Get-Command][31] with the **Syntax** parameter to get +cmdlet syntax. The output you see will show the template used for a resource block for the resource +you specify. ```powershell Get-DscResource -Syntax Service @@ -76,8 +72,7 @@ Inside a Configuration, a **Service** resource block might look like this to **E Spooler service is running. > [!NOTE] -> Before using a resource in a Configuration, you must import it using -> [Import-DSCResource](../configurations/import-dscresource.md). +> Before using a resource in a Configuration, you must import it using [Import-DSCResource][04]. ```powershell Configuration TestConfig @@ -133,58 +128,88 @@ Configuration TestConfig > Beginning in PowerShell 5.0, IntelliSense was added for DSC. This new feature allows you to use > TAB and Ctr+Space to auto-complete key names. -![Resource IntelliSense using Tab Completion](media/resources/resource-tabcompletion.png) +![Resource IntelliSense using Tab Completion][36] ## Types of resources Windows comes with built in resources and Linux has OS specific resources. There are resources for -[cross-node dependencies](../configurations/crossNodeDependencies.md), package management resources, -as well as [community owned and maintained resources](https://github.com/dsccommunity). You can use -the above steps to determine the syntax of these resources and how to use them. The pages that serve -these resources have been archived under **Reference**. +[cross-node dependencies][03], package management resources, as well as +[community owned and maintained resources][35]. You can use the above steps to determine the syntax +of these resources and how to use them. The pages that serve these resources have been archived +under **Reference**. ### Windows built-in resources -- [Archive Resource](../reference/resources/windows/archiveResource.md) -- [Environment Resource](../reference/resources/windows/environmentResource.md) -- [File Resource](../reference/resources/windows/fileResource.md) -- [Group Resource](../reference/resources/windows/groupResource.md) -- [GroupSet Resource](../reference/resources/windows/groupSetResource.md) -- [Log Resource](../reference/resources/windows/logResource.md) -- [Package Resource](../reference/resources/windows/packageResource.md) -- [ProcessSet Resource](../reference/resources/windows/ProcessSetResource.md) -- [Registry Resource](../reference/resources/windows/registryResource.md) -- [Script Resource](../reference/resources/windows/scriptResource.md) -- [Service Resource](../reference/resources/windows/serviceResource.md) -- [ServiceSet Resource](../reference/resources/windows/serviceSetResource.md) -- [User Resource](../reference/resources/windows/userResource.md) -- [WindowsFeature Resource](../reference/resources/windows/windowsFeatureResource.md) -- [WindowsFeatureSet Resource](../reference/resources/windows/windowsFeatureSetResource.md) -- [WindowsOptionalFeature Resource](../reference/resources/windows/windowsOptionalFeatureResource.md) -- [WindowsOptionalFeatureSet Resource](../reference/resources/windows/windowsOptionalFeatureSetResource.md) -- [WindowsPackageCabResource Resource](../reference/resources/windows/windowsPackageCabResource.md) -- [WindowsProcess Resource](../reference/resources/windows/windowsProcessResource.md) +- [Archive Resource][08] +- [Environment Resource][09] +- [File Resource][10] +- [Group Resource][11] +- [GroupSet Resource][12] +- [Log Resource][13] +- [Package Resource][14] +- [ProcessSet Resource][15] +- [Registry Resource][16] +- [Script Resource][17] +- [Service Resource][18] +- [ServiceSet Resource][19] +- [User Resource][20] +- [WindowsFeature Resource][24] +- [WindowsFeatureSet Resource][25] +- [WindowsOptionalFeature Resource][26] +- [WindowsOptionalFeatureSet Resource][27] +- [WindowsPackageCabResource Resource][28] +- [WindowsProcess Resource][29] ### Cross-Node dependency resources -- [WaitForAll Resource](../reference/resources/windows/waitForAllResource.md) -- [WaitForSome Resource](../reference/resources/windows/waitForSomeResource.md) -- [WaitForAny Resource](../reference/resources/windows/waitForAnyResource.md) +- [WaitForAll Resource][21] +- [WaitForSome Resource][23] +- [WaitForAny Resource][22] ### Package Management resources -- [PackageManagement Resource](../reference/resources/packagemanagement/PackageManagementDscResource.md) -- [PackageManagementSource Resource](../reference/resources/packagemanagement/PackageManagementSourceDscResource.md) +- [PackageManagement Resource][06] +- [PackageManagementSource Resource][07] #### Linux resources -- [Linux Archive Resource](../reference/resources/linux/lnxArchiveResource.md) -- [Linux Environment Resource](../reference/resources/linux/lnxEnvironmentResource.md) -- [Linux FileLine Resource](../reference/resources/linux/lnxFileLineResource.md) -- [Linux File Resource](../reference/resources/linux/lnxFileResource.md) -- [Linux Group Resource](../reference/resources/linux/lnxGroupResource.md) -- [Linux Package Resource](../reference/resources/linux/lnxPackageResource.md) -- [Linux Script Resource](../reference/resources/linux/lnxScriptResource.md) -- [Linux Service Resource](../reference/resources/linux/lnxServiceResource.md) -- [Linux SshAuthorizedKeys Resource](../reference/resources/linux/lnxSshAuthorizedKeysResource.md) -- [Linux User Resource](../reference/resources/linux/lnxUserResource.md) +The DSC for Linux resources are deprecated. For more information, see +[DSC for Linux Resources][05]. + + +[01]: ../configurations/compositeConfigs.md +[02]: ../configurations/configurations.md +[03]: ../configurations/crossNodeDependencies.md +[04]: ../configurations/import-dscresource.md +[05]: ../reference/resources/linux/index.md +[06]: ../reference/resources/packagemanagement/PackageManagementDscResource.md +[07]: ../reference/resources/packagemanagement/PackageManagementSourceDscResource.md +[08]: ../reference/resources/windows/archiveResource.md +[09]: ../reference/resources/windows/environmentResource.md +[10]: ../reference/resources/windows/fileResource.md +[11]: ../reference/resources/windows/groupResource.md +[12]: ../reference/resources/windows/groupSetResource.md +[13]: ../reference/resources/windows/logResource.md +[14]: ../reference/resources/windows/packageResource.md +[15]: ../reference/resources/windows/ProcessSetResource.md +[16]: ../reference/resources/windows/registryResource.md +[17]: ../reference/resources/windows/scriptResource.md +[18]: ../reference/resources/windows/serviceResource.md +[19]: ../reference/resources/windows/serviceSetResource.md +[20]: ../reference/resources/windows/userResource.md +[21]: ../reference/resources/windows/waitForAllResource.md +[22]: ../reference/resources/windows/waitForAnyResource.md +[23]: ../reference/resources/windows/waitForSomeResource.md +[24]: ../reference/resources/windows/windowsFeatureResource.md +[25]: ../reference/resources/windows/windowsFeatureSetResource.md +[26]: ../reference/resources/windows/windowsOptionalFeatureResource.md +[27]: ../reference/resources/windows/windowsOptionalFeatureSetResource.md +[28]: ../reference/resources/windows/windowsPackageCabResource.md +[29]: ../reference/resources/windows/windowsProcessResource.md +[30]: /powershell/module/microsoft.powershell.core/about/about_functions#functions-with-parameters +[31]: /powershell/module/microsoft.powershell.core/get-command +[32]: /powershell/module/psdesiredstateconfiguration/about/about_classes_and_dsc +[33]: /powershell/module/PSDesiredStateConfiguration/Get-DscResource +[34]: /windows/desktop/wmisdk/managed-object-format--mof- +[35]: https://github.com/dsccommunity +[36]: media/resources/resource-tabcompletion.png diff --git a/dsc/docs-conceptual/dsc-1.1/toc.yml b/dsc/docs-conceptual/dsc-1.1/toc.yml index 67a201e..632e4c2 100644 --- a/dsc/docs-conceptual/dsc-1.1/toc.yml +++ b/dsc/docs-conceptual/dsc-1.1/toc.yml @@ -10,8 +10,6 @@ items: href: overview/DscForEngineers.md - name: Getting started items: - - name: Get started with DSC for Linux - href: getting-started/lnxGettingStarted.md - name: Get started with DSC for Windows href: getting-started/winGettingStarted.md - name: Get started with DSC on Nano @@ -218,27 +216,7 @@ items: - name: WindowsProcess Resource href: reference/resources/windows/windowsProcessResource.md - name: Linux built-in resources - items: - - name: nxArchive Resource - href: reference/resources/linux/lnxArchiveResource.md - - name: nxEnvironment Resource - href: reference/resources/linux/lnxEnvironmentResource.md - - name: nxFile Resource - href: reference/resources/linux/lnxFileResource.md - - name: nxFileLine Resource - href: reference/resources/linux/lnxFileLineResource.md - - name: nxGroup Resource - href: reference/resources/linux/lnxGroupResource.md - - name: nxPackage Resource - href: reference/resources/linux/lnxPackageResource.md - - name: nxScript Resource - href: reference/resources/linux/lnxScriptResource.md - - name: nxService Resource - href: reference/resources/linux/lnxServiceResource.md - - name: nxSshAuthorizedKeys Resource - href: reference/resources/linux/lnxSshAuthorizedKeysResource.md - - name: nxUser Resource - href: reference/resources/linux/lnxUserResource.md + href: reference/resources/linux/index.md - name: PackageManagement built-in resources items: - name: PackageManagementDsc Resource