FAKE - F# Make


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 -> '?9457) -> '?9457
Type parameters: '?9457

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())
 )
Fork me on GitHub