Unlock-KFProcess

Syntax

Unlock-KFProcess 
  [-Handle] <handle> 
  [-ThrowErrors[:$true]]

Support

>= kenaflow 2.0.3

Return

Boolean.

$true => <handle> was a valid lock and it was release!

$false => <handle> was not a valid lock!

Description

This cmdlet can be used to unlock a previously gathered lock to a custom key.

Please read this article for further details: Locking.

Parameters

[-Handle] <handle>

The lock handle.

[-ThrowErrors[:$true]]

This is a default parameter for all kenaflow cmdlets. If set to $true (default!) the engine will pass exception within the cmdlet to the script for further handling.

Example

$lock = Lock-KFProcess -Key "TestLockKey" -MaxWaitInSeconds 10
if( $lock -ne $null ) {
	Test-KFProcessLock -Handle $lock
	Unlock-KFProcess $lock
} else {
	Write-KFLog "Cannot get a handle for the given key."
}

Discussion