{"id":903,"date":"2014-07-22T08:44:00","date_gmt":"2014-07-22T08:44:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2014\/07\/22\/deploying-using-powershell-desired-state-configuration-in-release-management\/"},"modified":"2022-07-13T06:31:56","modified_gmt":"2022-07-13T14:31:56","slug":"deploying-using-powershell-desired-state-configuration-in-release-management","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/deploying-using-powershell-desired-state-configuration-in-release-management\/","title":{"rendered":"Deploying using PowerShell Desired State Configuration in Release Management"},"content":{"rendered":"<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;line-height: 13pt\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span>With Microsoft Release Management 2013 Update 3 RC, you can now use Windows PowerShell or Windows PowerShell Desired State Configuration (DSC) for deploying and managing configuration data<\/span><span>. <\/span><\/span>\n<\/p>\n<p>\u00a0<\/p>\n<blockquote>\n<\/blockquote>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;line-height: 13pt\">\n>   <span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span style=\"'\"><span style=\"color: #333333\"><span style=\"font-weight: bold\">Windows PowerShell (PS)<\/span><\/span><\/span><\/span>\n> <\/p>\n<blockquote>\n<\/blockquote>\n<p class=\"MsoNormal\" style=\"margin: 0px 0px 0pt;line-height: 12pt\">\n>   <span style=\"line-height: 13pt;font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span style=\"'\"><span style=\"color: #767171\"><span> <br \/>Refer to <\/span><a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/bb978526.aspx\" target=\"_blank\" rel=\"noopener\"><span>Scripting with Windows PowerShell<\/span><\/a><span> (PS) for more details. These scripts can be same as what you might have been already using to deploy using Microsoft Deployment Agent.<\/span><\/span><\/span><\/span>\n> <\/p>\n<blockquote>\n<\/blockquote>\n<p class=\"MsoNormal\" style=\"margin: 0px 0px 0pt;line-height: 12pt\">\n>   <span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span style=\"line-height: 13pt\"><span style=\"'\"> <br \/><span style=\"color: #767171\">RM 2013 Update 3 \u201cDeploy using PowerShell\u201d requires PS version on the target servers to be of version 4.0 or higher.<\/span><\/span><\/span><span style=\"line-height: 13pt\"><span style=\"'\"><span style=\"color: #767171\">\u00a0<\/span><\/span><\/span><\/span>\n> <\/p>\n<blockquote>\n<\/blockquote>\n<h3 style=\"margin: 2pt 0cm 0pt;line-height: 13pt\">\n>   <span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span style=\"'\"><span style=\"color: #333333\"><span style=\"font-weight: bold\"> <br \/><span> <br \/>Windows PowerShell Desired State Configuration (DSC) <br \/><\/span><\/span><\/span> <br \/><\/span><\/span>\n> <\/h3>\n<blockquote>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span>DSC is a PowerShell extension and ships with Windows Server 2012 R2 and Windows 8.1. DSC is also part of <\/span><a href=\"http:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=40855\" target=\"_blank\" rel=\"noopener\"><span>Windows Management Framework 4.0<\/span><\/a><span> which ships as an optional update and can be installed to Windows Server 2012, Windows Server 2008R2, Windows 7 and Windows 8. <\/span>\u00a0<\/span><\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span>The PowerShell v4 DSC extension adds a new keyword called \u201cConfiguration\u201d. With this keyword, which is actually a \u201cfunction\u201d, you define a DSC configuration block. RM leverages <\/span><a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/dn249922.aspx\" target=\"_blank\" rel=\"noopener\"><span>Windows DSC Local Configuration Management Engine<\/span><\/a><span> to apply the configuration when a PowerShell script has \u201cDSC Configuration\u201d block in it.<\/span><\/span><\/p>\n<\/blockquote>\n<h3 style=\"margin: 2pt 0cm 0pt;line-height: 13pt\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span style=\"font-weight: bold\"> <br \/>Deployments using PS\/DSC in Release Management<\/span><\/span>\n<\/h3>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;line-height: 13pt\">\n  \u00a0\n<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;line-height: 13pt\">\n  <span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"> <br \/>\u201cPSScriptPath\u201d action parameter<\/span>\n<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;line-height: 13pt\">\n  <span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span><span>\u00a0 <br \/>Specify t<span>he relative path to the PS\/DSC script file with respect to the package path (Component). <\/span> <\/p>\n<p><\/span><\/span><a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/07\/8880.image_thumb_087C7071.png\"><span><img decoding=\"async\" style=\"padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px;border-width: 0px\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/07\/8880.image_thumb_087C7071.png\" alt=\"image\" width=\"244\" height=\"151\" border=\"0\" \/><\/span><\/a><\/span>\n<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;line-height: 13pt\">\n  <span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><strong><span style=\"line-height: 18pt\"><span> <\/p>\n<p>\u201cPSConfigurationPath\u201d action parameter<\/span><\/span><\/strong><\/span>\n<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;line-height: 13pt\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Specify t<span>he relative path to the PS\/DSC script initialization file with respect to the package path (Component). <span>This is an optional parameter, when set, RM will run this PS script prior invoking the <span>main-script<\/span> file.<\/span><\/span><\/span>\n<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;line-height: 13pt\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span><a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/07\/5734.image_thumb_004A5E30.png\"><img decoding=\"async\" style=\"padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px;border: 0px\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/07\/5734.image_thumb_004A5E30.png\" alt=\"image\" width=\"244\" height=\"147\" border=\"0\" \/><\/a><\/span> <\/span><\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">In RM, you can define configuration data separately from the logic of your configuration in a PS script file and use it to initialize the main script (Here main-script is the actual PS\/DSC script referred by \u2018<em>PSScriptPath\u2019<\/em>).<\/span>\n<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;line-height: 13pt\">\n  \u00a0\n<\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span>Variables initialized here will be visible to the main script file. <\/span><span>By using initialization script, you can potentially &#8211; <\/span><\/span><\/p>\n<ul>\n<li><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Initialize environment specific variables<\/span><\/li>\n<li><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Configure LCM setting<\/span><\/li>\n<li><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Install custom Modules <br \/><\/span><\/li>\n<\/ul>\n<p class=\"MsoNormal\" style=\"margin: 0cm 0cm 10pt;line-height: 13pt\">\n  <span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Initialization PS script file has following advantages: <\/span>\n<\/p>\n<ul>\n<li><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">It allows you to reuse your configuration data for different resources, nodes, and configurations.<\/span><\/li>\n<li><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Configuration logic is more reusable if it does not contain hard-coded data. This is similar to good scripting guidelines for functions.<\/span><\/li>\n<li><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">If some of the data needs to change, you can make the changes in one location, thereby saving time and reducing errors. <br \/><\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><strong> <br \/>Initialize environment specific variables<\/strong> <\/span><\/p>\n<p>\u00a0<\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">a)\u00a0\u00a0\u00a0 Look at the below sample which shows how you can parameterize your main DSC script using this initialization script file.<\/span><\/p>\n<p>\u00a0<\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Sample PS DSC script file <\/span><\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\" style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\">\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum1\" style=\"color: #606060\"> 1:<\/span> Configuration MyDscConfiguration<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum2\" style=\"color: #606060\"> 2:<\/span> { <\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum3\" style=\"color: #606060\"> 3:<\/span> Node $AllNodes.NodeName<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum4\" style=\"color: #606060\"> 4:<\/span> {<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum5\" style=\"color: #606060\"> 5:<\/span> File MyExampleFileCopyResource<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum6\" style=\"color: #606060\"> 6:<\/span> { <\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum7\" style=\"color: #606060\"> 7:<\/span> Ensure = <span style=\"color: #006080\">\"Present\"<\/span> <\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum8\" style=\"color: #606060\"> 8:<\/span> Type = <span style=\"color: #006080\">\"Directory\"<\/span><\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum9\" style=\"color: #606060\"> 9:<\/span> Recurse = $<span style=\"color: #0000ff\">true<\/span><\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum10\" style=\"color: #606060\"> 10:<\/span> SourcePath = $Node.SourcePathtoFolder<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum11\" style=\"color: #606060\"> 11:<\/span> DestinationPath = $Node.DestinationPathtoFolder<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum12\" style=\"color: #606060\"> 12:<\/span> }<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum13\" style=\"color: #606060\"> 13:<\/span> <span style=\"color: #008000\"># Other DSC resources, custom resources<\/span><\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum14\" style=\"color: #606060\"> 14:<\/span> }<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum15\" style=\"color: #606060\"> 15:<\/span> }<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span id=\"lnum16\" style=\"color: #606060;font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"> 16:&nbsp; <\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum17\" style=\"color: #606060\"> 17:<\/span> MyDscConfiguration &ndash;ConfigurationData $ConfigData &ndash;Verbose<\/span><\/pre>\n<\/p><\/div>\n<\/div>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Initialization PS Script file <\/span><\/p>\n<p>\u00a0<\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\" style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\">\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum1\" style=\"color: #606060\"> 1:<\/span> $ConfigData = @{<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum2\" style=\"color: #606060\"> 2:<\/span> AllNodes = <\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum3\" style=\"color: #606060\"> 3:<\/span> @(<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum4\" style=\"color: #606060\"> 4:<\/span> @{<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum5\" style=\"color: #606060\"> 5:<\/span> NodeName = $env:COMPUTERNAME;<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum6\" style=\"color: #606060\"> 6:<\/span> SourcePath = &ldquo;$env:SystemDriveSourcePath\"<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum7\" style=\"color: #606060\"> 7:<\/span> DestinationPath = &ldquo;$env:windirDestinationPath&rdquo;<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum8\" style=\"color: #606060\"> 8:<\/span> }<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum9\" style=\"color: #606060\"> 9:<\/span> )<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum10\" style=\"color: #606060\"> 10:<\/span> }<\/span><\/pre>\n<\/p><\/div>\n<\/div>\n<p>\u00a0<\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span>Note:<\/span><\/span><\/p>\n<ul>\n<li><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">$ConfigData is initialized using PS script file specified in \u2018PSConfigurationPath\u2019<\/span><\/li>\n<li><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Ensure that you don\u2019t specify\u00a0 \u201c\u2013OutputPath\u201d parameter for the MOF file. RM handles the MOF file generated and its cleanup.<\/span><\/li>\n<li><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">You don\u2019t need to call Start-DscConfiguration as you might\u2019ve noticed. RM applies the cmdlet as part of the DSC execution<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><strong>Configure LCM settings <br \/><\/strong><\/span><\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span> <\/p>\n<p>Initialization script file can also be used to configure the LCM (Local Configuration Manager engine) of the target node. <\/span><\/span><\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"> <br \/>Example:<\/span><\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\" style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\">\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum1\" style=\"color: #606060\"> 1:<\/span> Configuration ExampleLCMConfig<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum2\" style=\"color: #606060\"> 2:<\/span> {<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum3\" style=\"color: #606060\"> 3:<\/span> Node &ldquo;localhost&rdquo;<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum4\" style=\"color: #606060\"> 4:<\/span> {<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum5\" style=\"color: #606060\"> 5:<\/span> LocalConfigurationManager<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum6\" style=\"color: #606060\"> 6:<\/span> {<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum7\" style=\"color: #606060\"> 7:<\/span> ConfigurationModeFrequencyMins = 45<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum8\" style=\"color: #606060\"> 8:<\/span> ConfigurationMode = <span style=\"color: #006080\">\"ApplyAndAutocorrect\"<\/span><\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum9\" style=\"color: #606060\"> 9:<\/span> RefreshFrequencyMins = 90<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum10\" style=\"color: #606060\"> 10:<\/span> RebootNodeIfNeeded = $<span style=\"color: #0000ff\">true<\/span><\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum11\" style=\"color: #606060\"> 11:<\/span> AllowModuleOverwrite = $<span style=\"color: #0000ff\">false<\/span><\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum12\" style=\"color: #606060\"> 12:<\/span> }<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum13\" style=\"color: #606060\"> 13:<\/span> }<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum14\" style=\"color: #606060\"> 14:<\/span> }<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span id=\"lnum15\" style=\"color: #606060;font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"> 15:&nbsp; <\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum16\" style=\"color: #606060\"> 16:<\/span> ExampleLCMConfig -OutputPath <span style=\"color: #006080\">\"c:userspublicdsc\"<\/span><\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum17\" style=\"color: #606060\"> 17:<\/span> Set-DscLocalConfigurationManager -Path <span style=\"color: #006080\">\"c:userspublicdsc\"<\/span> <\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span id=\"lnum18\" style=\"color: #606060;font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"> 18:&nbsp; <\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum19\" style=\"color: #606060\"> 19:<\/span> <span style=\"color: #008000\"># Cleanup the 'meta MOF' generated<\/span><\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span id=\"lnum20\" style=\"color: #606060;font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"> 20:&nbsp; <\/span><\/pre>\n<\/p><\/div>\n<\/div>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Note: <\/span><\/p>\n<ul>\n<li><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">RM doesn\u2019t apply \u2018Set-DscLocalConfigurationManager\u2019, needs to be set explicitly as shown in the sample above<\/span><\/li>\n<li><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Cleanup of \u2018Meta MOF\u2019 file has to be handled outside of RM<\/span><\/li>\n<\/ul>\n<p>\u00a0<\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><strong>Install custom modules<\/strong><\/span><\/p>\n<p>\u00a0<\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Initialization script to install custom modules<\/span><\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Example<\/span><\/p>\n<ul>\n<li><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Drop the custom module along with build. For e.g. custom modules are packaged under \u201cCustomModules\u201d folder in the build <br \/><\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><a href=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/07\/3312.image_thumb_451BA3C6.png\"><img decoding=\"async\" style=\"padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px;border: 0px\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/07\/3312.image_thumb_451BA3C6.png\" alt=\"image\" width=\"173\" height=\"244\" border=\"0\" \/><\/a> <\/span><\/p>\n<ul>\n<li><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Copy custom modules using Initialization script <br \/><\/span><\/li>\n<\/ul>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\" style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\">\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum1\" style=\"color: #606060\"> 1:<\/span> Copy-Item $applicationPathModules $env:psmodulepath.split(<span style=\"color: #006080\">\";\"<\/span>)[1] -Force -Recurse<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span id=\"lnum2\" style=\"color: #606060;font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"> 2:&nbsp; <\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum3\" style=\"color: #606060\"> 3:<\/span> $ConfigData = @{<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum4\" style=\"color: #606060\"> 4:<\/span> AllNodes = <\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum5\" style=\"color: #606060\"> 5:<\/span> @(<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum6\" style=\"color: #606060\"> 6:<\/span> @{<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum7\" style=\"color: #606060\"> 7:<\/span> NodeName = $env:COMPUTERNAME;<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum8\" style=\"color: #606060\"> 8:<\/span> SourcePath = &ldquo;$env:SystemDriveSourcePath\"<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum9\" style=\"color: #606060\"> 9:<\/span> DestinationPath = &ldquo;$env:windirDestinationPath&rdquo;<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum10\" style=\"color: #606060\"> 10:<\/span> }<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum11\" style=\"color: #606060\"> 11:<\/span> )<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum12\" style=\"color: #606060\"> 12:<\/span> }<\/span><\/pre>\n<\/p><\/div>\n<\/div>\n<p>\u00a0<\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><strong> <br \/>$applicationPath parameter<\/strong> <\/span><br \/>\n\u00a0<br \/>\n<span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span> <br \/>\u201c$applicationPath\u201d<\/span>\u00a0 <span>variable points to the root folder path of the build that has been copied locally onto the target node by RM.<\/span><\/span><\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"> <br \/>Example<\/span><\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><strong> <\/p>\n<p>Consider this scenario<\/strong>: As part of your deployment if you intend to copy build to a folder on target machine say c: DeploymentFolder or D: DeploymentFolder<\/span><\/p>\n<p>\u00a0<\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Initialization file <\/span><\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\" style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\">\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum1\" style=\"color: #606060\"> 1:<\/span> $ConfigData = @{<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum2\" style=\"color: #606060\"> 2:<\/span> AllNodes = @(<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum3\" style=\"color: #606060\"> 3:<\/span> @{ <\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum4\" style=\"color: #606060\"> 4:<\/span> NodeName = $env:COMPUTERNAME;<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum5\" style=\"color: #606060\"> 5:<\/span> DeploymentPath = $env:SystemDrive + <span style=\"color: #006080\">\"DeploymentFolder\"<\/span><\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum6\" style=\"color: #606060\"> 6:<\/span> }<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum7\" style=\"color: #606060\"> 7:<\/span> )<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum8\" style=\"color: #606060\"> 8:<\/span> }<\/span><\/pre>\n<\/p><\/div>\n<\/div>\n<p>\u00a0<\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"> <br \/>DSC script file (main-script)<\/span><\/p>\n<div id=\"codeSnippetWrapper\">\n<div id=\"codeSnippet\" style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\">\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum1\" style=\"color: #606060\"> 1:<\/span> Configuration FileCopy{<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum2\" style=\"color: #606060\"> 2:<\/span> Node $AllNodes.NodeName<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum3\" style=\"color: #606060\"> 3:<\/span> {<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum4\" style=\"color: #606060\"> 4:<\/span> File CopyDeploymentBits<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum5\" style=\"color: #606060\"> 5:<\/span> {<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum6\" style=\"color: #606060\"> 6:<\/span> Ensure = <span style=\"color: #006080\">\"Present\"<\/span><\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum7\" style=\"color: #606060\"> 7:<\/span> Type = <span style=\"color: #006080\">\"Directory\"<\/span><\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum8\" style=\"color: #606060\"> 8:<\/span> Recurse = $<span style=\"color: #0000ff\">true<\/span><\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum9\" style=\"color: #606060\"> 9:<\/span> SourcePath = Join-Path $applicationPath &ldquo;DeploymentBits&rdquo; <\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum10\" style=\"color: #606060\"> 10:<\/span> DestinationPath = $Node.DeploymentPath<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum11\" style=\"color: #606060\"> 11:<\/span> }<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum12\" style=\"color: #606060\"> 12:<\/span> }<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum13\" style=\"color: #606060\"> 13:<\/span> }<\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span id=\"lnum14\" style=\"color: #606060;font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"> 14:&nbsp; <\/span><\/pre>\n<pre style=\"overflow: visible;font-size: 8pt;font-family: 'Courier New', courier, monospace;width: 100%;color: black;direction: ltr;text-align: left;margin: 0em;line-height: 12pt;background-color: #f4f4f4;border-style: none;padding: 0px\"><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"><span id=\"lnum15\" style=\"color: #606060\"> 15:<\/span> FileCopy -ConfigurationData $ConfigData &ndash;Verbose<\/span><\/pre>\n<\/p><\/div>\n<\/div>\n<p>\u00a0<\/p>\n<p><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\"> <br \/>Note:<\/span><\/p>\n<ul>\n<li><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">\u201c$applicationPath\u201dwill always point to root directory of your build which you are deploying<\/span><\/li>\n<li><span style=\"font-family: tahoma,arial,helvetica,sans-serif;font-size: small\">Here we have used a DSC File resource to copy the folders recursively.\u00a0 As the source path refers to \u201c$applicationPath\u201d<\/span><\/li>\n<\/ul>\n<p>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With Microsoft Release Management 2013 Update 3 RC, you can now use Windows PowerShell or Windows PowerShell Desired State Configuration (DSC) for deploying and managing configuration data. \u00a0 > Windows PowerShell (PS) > > Refer to Scripting with Windows PowerShell (PS) for more details. These scripts can be same as what you might have been [&hellip;]<\/p>\n","protected":false},"author":62,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[226,1],"tags":[],"class_list":["post-903","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ci","category-devops"],"acf":[],"blog_post_summary":"<p>With Microsoft Release Management 2013 Update 3 RC, you can now use Windows PowerShell or Windows PowerShell Desired State Configuration (DSC) for deploying and managing configuration data. \u00a0 > Windows PowerShell (PS) > > Refer to Scripting with Windows PowerShell (PS) for more details. These scripts can be same as what you might have been [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/62"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=903"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/903\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}