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

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

Target "Install" (fun _ -> 
     requiresAdmin (fun _ -> installMSI())
 )
Fork me on GitHub