PowerShell Logo Small

Remove-DscConfigurationDocument



This is the built-in help made by Microsoft for the command 'Remove-DscConfigurationDocument', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Removes a configuration document from the DSC configuration store.

SYNTAX


Remove-DscConfigurationDocument [-AsJob] [-CimSession [<CimSession[]>]] [-Force] [-ThrottleLimit [<Int32>]] -Stage {Current | Pending | Previous} [-Confirm] [-WhatIf]
[<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Remove-DscConfigurationDocument cmdlet removes a configuration document (.mof file) from the DSC configuration store. During configuration, the Start-DscConfiguration
cmdlet copies a .mof file into to a folder on the target computer. This cmdlet removes that configuration document and does additional cleanup.


This cmdlet is available only as part of the November 2014 update rollup for Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2
(http://support.microsoft.com/en-us/kb/3000850) from the Microsoft Support library. Before you use this cmdlet, review the information in What's New in Windows PowerShell
(http://technet.microsoft.com/library/hh857339.aspx) in the TechNet library.



<

RELATED LINKS

Windows PowerShell Desired State Configuration Overview
Get-DscConfiguration
Get-DscConfigurationStatus

REMARKS

<

Examples


Example 1: Remove the current configuration document

PS C:\>$Session = New-CimSession -ComputerName "Server01" -Credential ACCOUNTS\PattiFuller
PS C:\> Remove-DscConfigurationDocument -Stage Current -CimSession $Session



The first command creates a CIM session by using the New-CimSession cmdlet, and then stores the CimSession object in the $Session variable. The command prompts you for a
password. For more information, type Get-Help New-CimSession.

The second command removes the current configuration document for the computer specified in the CimSession stored in $Session.