Restore-CMApplicationRevision

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Restore-CMApplicationRevision

Restores a Configuration Manager application to a previous revision.

Syntax

Parameter Set: RestoreByName_Id
Restore-CMApplicationRevision -ApplicationName <String> -RevisionId <String> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: RestoreById_Id
Restore-CMApplicationRevision -ApplicationId <String> -RevisionId <String> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: RestoreById_Object
Restore-CMApplicationRevision -ApplicationId <String> -Revision <IResultObject> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: RestoreByName_Object
Restore-CMApplicationRevision -ApplicationName <String> -Revision <IResultObject> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: RestoreByObject_Id
Restore-CMApplicationRevision -Application <IResultObject> -RevisionId <String> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: RestoreByObject_Object
Restore-CMApplicationRevision -Application <IResultObject> -Revision <IResultObject> [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Restore-CMApplicationRevision cmdlet restores an application distributed by Microsoft System Center 2012 Configuration Manager to a previous specified revision. When you revise an application or a deployment type in an application, System Center 2012 Configuration Manager creates a new revision of the application. System Center 2012 Configuration Manager stores previous revisions.

For more information about how to manage application revisions, see the How to Manage Application Revisions in Configuration Manager topic in the TechNet Library at https://go.microsoft.com/fwlink/?LinkId=262652.

Parameters

-Application<IResultObject>

Specifies an application object.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ApplicationId<String>

Specifies the ID of an application.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ApplicationName<String>

Specifies the name of an application.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Revision<IResultObject>

Specifies an application revision object.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-RevisionId<String>

Specifies the identifier of an application revision object.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before executing the command.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Examples

Example 1: Restore a revision by application name

This command restores an application named cn to a revision that has the ID 16781897.

PS C:\> Restore-CMApplicationRevision -ApplicationName "cn" -RevisionId 16781897

Example 2: Restore a revision by application ID

This command restores an application that has the ID 16782012 to a revision that has the ID 16781897.

PS C:\> Restore-CMApplicationRevision -ApplicationId 16782012 -RevisionId 16781897

Example 3: Restore a revision to an application by using variables

This example shows you how to use Get-Object cmdlet queries to restore an application to a revision.

The first command uses the Get-Object cmdlet to get the application object named cn and then stores the object in the $AppLatest variable.

The second command uses Get-Object to get the revision for an application named cn that has the ID 16781897 and then stores the object in the $App variable.

The third command restores the application stored in $AppLatest to the revision stored in $App.

PS C:\> $AppLatest = Get-Object -Query "SELECT * FROM SMS_ApplicationLatest where LocalizedDisplayName = 'cn'"

PS C:\>$App = Get-Object -Query "SELECT * FROM SMS_Application where LocalizedDisplayName = 'cn' and CI_ID = 16781897"

PS C:\>Restore-CMApplicationRevision -Application $AppLatest -Revision $App

Example 4: Restore a revision to an application that has a specified name

The first command uses Get-Object to get the revision for an application named cn that has the ID 16781897 and then stores the object in the $App variable.

The second command restores an application named cn to the revision stored in $App.

PS C:\> $App = Get-Object -Query "SELECT * FROM SMS_Application where LocalizedDisplayName = 'cn' and CI_ID = 16781897"

PS C:\>Restore-CMApplicationRevision -ApplicationName "cn" -Revision $App

Example 5: Restore a revision to an application that has a specified ID

The first command gets the application object named cn and then stores the object in the $AppLatest variable.

The second command restores the application stored in $AppLatest to a revision that has the ID 16781897.

PS C:\> $AppLatest = Get-Object -Query "SELECT * FROM SMS_ApplicationLatest where LocalizedDisplayName = 'cn'"

PS C:\>Restore-CMApplicationRevision -Application $AppLatest -RevisionId 16781897

Example 6: Restore a specific revision to an application that has a specified ID

The first command uses Get-Object to get the revision for an application named cn that has the ID 16781897 and then stores the object in the $App variable.

The second command restores the application that has the ID 16782018 to the revision stored in $App.

PS C:\> $App = Get-Object -Query "SELECT * FROM SMS_Application where LocalizedDisplayName = 'cn' and CI_ID = 16781897" 

PS C:\>Restore-CMApplicationRevision -ApplicationId 16782018 -Revision $App