# CheckoutFile

**EventNames:**

- CheckoutFile_Restrictions
- CheckoutFile_Pre
- CheckoutFile_Post

**Parameters**

| Type                                                 | Name       | Description                                                                                                                                                                                                                                                                                                                                          |
| ---------------------------------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [File](powervault:code_reference/objects/file) | file       | The file which should get / is checked=out.<br><br>**Restrictions and Pre:** <br>In *Restrictions* and *Pre* you have the future data set on this object like ` _NewComment` and `_NewCheckoutMachine`.<br><br>**Post:**<br>In *POST* you can retrieve the information from the previous events by using the properties `_OldComment` and `_OldCheckoutMachine`. |
| string                                               | localPath  | The local path where the file should / is checked=out                                                                                                                                                                                                                                                                                                |
| bool                                                 | successful | **Post**:<br>The information whether the Web Service call was successful or not is only available in *Post* events.                                                                                                                                                                                                                                                         |

**Examples:**\
CheckoutFile_Restrictions:

```PowerShell
Register-VaultEvent -EventName CheckoutFile_Restrictions -Action 'RestrictCheckoutFile'
function RestrictCheckoutFile($file, $localPath) {
	#Write event code here
}
```

CheckoutFile_Pre:

```PowerShell
Register-VaultEvent -EventName CheckoutFile_Pre -Action 'PreCheckoutFile'
function PreCheckoutFile($file, $localPath) {
	#Write event code here
}
```

CheckoutFile_Post:

```PowerShell
Register-VaultEvent -EventName CheckoutFile_Post -Action 'PostCheckoutFile'
function PostCheckoutFile($file, $localPath, $successful) {
	#Write event code here
}
```