DSC ps1 VS Regular.ps1

I am a developer, trying to understand DSC better.

Regular.ps1 - this script copy files from \smb.production share to c:\

DSC.ps1- this script create DSC.MOF file, when i Call start-dscconfiguration DSC this will copy files from \smb.production share to c:.

My question is what is difference between pushing Regular.ps1 through SCCM to all my servers vc DSC push or which is efficient way ?

DSC gives a few advantages over traditional imperative scripts:

  • Idempotent resources. We’re expected to write resources in such a way that they can be executed over and over again, and will leave the system in exactly the state it’s supposed to be. I don’t know about you, but I didn’t always put quite that level of rigor into my older scripts. :slight_smile:

  • Monitored for drift over time. Depending on how you’ve configured the LCM, it will keep an eye on the things you’ve told it to configure, and either log an event when something’s changed, or it’ll just correct the problem.

  • Declarative syntax. Easier for non-developers to write and maintain, if that workflow is appropriate for your organization.

That said, if you want this to be a one-time file copy, there’s really no reason to bother with DSC. (And in fact, you’d be overwriting any other DSC configuration that was already present on the target systems, if you used it for such a small task.)

Awesome.thanks. it gave me some idea about DSC.