Resource Management Powershell
Documentation Home
  • Home
  • Installation
    • Installing the PowerShell module
  • Configuration
    • Configuration management
    • ConfigSync File
    • Variables File
      • <Variables> element
        • <Variable> element
    • <Operations> element
      • <ResourceOperation> element
      • <AnchorAttributes> element
      • <AnchorAttribute> element
      • <AttributeOperations> element
        • <AttributeOperation> element
    • Building references
  • Usage
    • Cmdlet reference
      • Set-ResourceManagementClient
      • Get-Resource
      • Save-Resource
      • Search-Resources
      • Search-ResourcesPaged
      • Remove-Resource
      • New-Resource
      • Update-ResourceManagementClientSchema
      • Import-RMConfig
      • New-XPathQuery
      • New-XPathQueryGroup
      • New-XPathExpression
      • Get-ApprovalRequest
      • Set-PendingApprovalRequest
  • help and support
    • Quick reference guide
    • Working with different data and attribute types
    • XPath expression examples
Powered by GitBook
On this page
  • Description
  • Syntax
  • Parameters
  • Examples
  1. Usage
  2. Cmdlet reference

Set-PendingApprovalRequest

PreviousGet-ApprovalRequestNextQuick reference guide

Last updated 2 years ago

Description

The Set-PendingApprovalRequest cmdlet allows you approve or reject an approval request. The cmdlet can be combined with the to approve or reject pending approval requests for the current user.

Syntax

Set-PendingApprovalRequest -ApprovalObject <PSObject> -Decision <ApprovalDecision> [-Reason <string>]

Parameters

ApprovalObject

Required. An Approval object obtained using the cmdlet that is in the Pending state

Decision

Required. The approval decision. This can be either Approved or Rejected

Reason

Optional. The reason for the approval or rejection

Examples

Individually get and approve each request

$requests = Get-ApprovalRequest
foreach ($request in $requests)
{
   if ($request.Status -eq "Pending")
   {
       Set-PendingApprovalRequest -ApprovalObject $request -Decision Approved
   }
}

Approve all pending requests using the pipeline

Get-ApprovalRequest -Status Pending | Set-PendingApprovalRequest -Decision Approved -Reason "Make it so!"

Reject all pending requests using the pipeline

Get-ApprovalRequest -Status Pending | Set-PendingApprovalRequest -Decision Reject -Reason "Not today"
Get-ApprovalRequest
Get-ApprovalRequest