Note: This API documentation is for FAKE version 4. The migration API documentation can be found here. The API documentation for the new fake 5 modules can be found here

PermissionsHelper

Contains functions which allow to deal with permissions.

Functions and values

Function or valueDescription
isAdmin(identity)
Signature: identity:WindowsIdentity -> bool

Returns whether the given user has administrator permissions.

Parameters

  • identity - The windows identity of the user in question.
requiresAdmin(f)
Signature: f:(unit -> '?10547) -> '?10547
Type parameters: '?10547

Checks that the current user has administrator permissions - otherwise it throws an exception.

Parameters

  • f - This Function will be excuted if the use has the right permissions.

Sample

1: 
2: 
3: 
Target "Install" (fun _ -> 
     requiresAdmin (fun _ -> installMSI())
 )