MSBuild.ExtensionPack.FileSystem Namespace

MSBuild Extension Pack

MSBuild.ExtensionPack.FileSystem Namespace MSBuild Extension Pack Help 4.0.12.0

Overview

This namespace hosts tasks that can be used to work with files and folders.
Classes

  Class Description
Public class Code example Detokenise
Valid TaskActions are:

Analyse (Required: TargetFiles or TargetPath Optional: CommandLineValues, DisplayFiles, TextEncoding, ForceWrite, ReplacementValues, Separator, TokenPattern, TokenExtractionPattern Output: FilesProcessed)

Detokenise (Required: TargetFiles or TargetPath Optional: SearchAllStores, IgnoreUnknownTokens, CommandLineValues, DisplayFiles, TextEncoding, ForceWrite, ReplacementValues, Separator, TokenPattern, TokenExtractionPattern Output: FilesProcessed, FilesDetokenised)

Report (Required: TargetFiles or TargetPath Optional: DisplayFiles, TokenPattern, ReportUnusedTokens Output: FilesProcessed, TokenReport, UnusedTokens)

Remote Execution Support: No

Public class Code example File
Valid TaskActions are:

AddAttributes (Required: Files)

AddSecurity (Required: Users, AccessType, Path or Files Optional: Permission

CheckContainsContent (Required: Files, RegexPattern Optional: RegexOptionList Output: Result)

Concatenate (Required: Files, TargetPath)

CountLines (Required: Files Optional: CommentIdentifiers, MazSize, MinSize Output: TotalLinecount, CommentLinecount, EmptyLinecount, CodeLinecount, TotalFilecount, IncludedFilecount, IncludedFiles, ExcludedFilecount, ExcludedFiles, ElapsedTime)

Create (Required: Files Optional: Size). Creates file(s)

GetChecksum (Required: Path Output: Checksum)

GetTempFileName (Output: Path)

FilterByContent (Required: Files, RegexPattern Optional: RegexOptionList Output: IncludedFiles, IncludedFilecount, ExcludedFilecount, ExcludedFiles)

Move (Required: Path, TargetPath)

RemoveAttributes (Required: Files)

RemoveLines (Required: Files, Lines Optional: RegexOptionList, AvoidRegex, MatchWholeLine). This will remove lines from a file. Lines is a regular expression unless AvoidRegex is specified

RemoveSecurity (Required: Users, AccessType, Path or Files Optional: Permission

Replace (Required: RegexPattern Optional: Replacement, Path, TextEncoding, Files, RegexOptionList)

SetAttributes (Required: Files)

WriteLines (Required: Files, Lines). This will add lines to a file if the file does NOT contain them. The match is case insensitive.

Remote Execution Support: No

Public class Code example FileVersion
Valid TaskActions are:

Increment (Required: File Optional: Increment Output: Value)

Reset (Required: File Optional: Value Output: Value)

Remote Execution Support: No

Public class Code example FindUnder
Valid TaskActions are:

FindFiles (Required: Path Optional: ModifiedAfterDate, ModifiedBeforeDate, Recursive, SearchPattern Output: FoundItems)

FindDirectories (Required: Path Optional: ModifiedAfterDate, ModifiedBeforeDate, Recursive, SearchPattern Output: FoundItems)

FindFilesAndDirectories (Required: Path Optional: ModifiedAfterDate, ModifiedBeforeDate, Recursive, SearchPattern Output: FoundItems)

Remote Execution Support: NA

Public class Code example Folder
Valid TaskActions are:

AddSecurity (Required: Path, Users Optional: AccessType, Permission)

DeleteAll (Required: Path, Match)

Get (Required: Path Optional: Match, Recursive)

Move (Required: Path, TargetPath)

RemoveContent (Required: Path Optional: Force, RetryCount)

RemoveSecurity (Required: Path, Users Optional: AccessType)

Remote Execution Support: No

Public class Code example RoboCopy
This task wraps RoboCopy. Successful non-zero exit codes from Robocopy are set to zero to not break MSBuild. Use the ReturnCode property to access the exit code from Robocopy
Public class Code example Share
Valid TaskActions are:

CheckExists (Required: ShareName Output: Exists)

Create (Required: ShareName, SharePath Optional: Description, MaximumAllowed, CreateSharePath, AllowUsers, DenyUsers)

Delete (Required: ShareName)

ModifyPermissions (Required: ShareName Optional: AllowUsers, DenyUsers).

SetPermissions (Required: ShareName Optional: AllowUsers, DenyUsers). SetPermissions will reset all existing permissions.

Remote Execution Support: Yes