Retrieves a filtered list of files from a specified folder, processing `.mfignore` and `.mforder` rules.
get-mfFolderItems -path <String> [-psScriptsOnly] [-ProgressAction <ActionPreference>] [<CommonParameters>]
get-mfFolderItems -path <String> [-psScriptsOnly] [-destination <String>] [-copy]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
The `get-mfFolderItems` function scans a folder and applies filtering rules to return a curated list of files. It offers additional filtering logic, such as:
The function ensures all returned paths are fully qualified. This function is primarily used to assist the get-mfFolderItemDetails as well as build-mfProject. The -copy switch is added to cleanly copy resources and binaries with build-mfProject
get-mfFolderItems -path '.\source\functions' -psScriptsOnly
Scans `.\source\functions`, retrieves only `.ps1` files, and excludes files matching `.mfignore` rules.
get-mfFolderItems -path '.\source\functions' -destination '.\build\functions' -copy
Scans `.\source\functions`, retrieves filtered files, and copies them to `.\build\functions`.
Path to get items from
Type: String
Parameter Sets: (All)
Aliases: s
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
Flag to copy scripts only
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Flag to copy scripts only
Type: String
Parameter Sets: Copy
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Flag to actually copy files and not just output
Type: SwitchParameter
Parameter Sets: Copy
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
ValueFromPipelineByPropertyName
).[String]
) - Name of the file.[String]
) - Full file path.[String]
) - Path relative to the source folder.[String]
) - Name of the source folder.[String]
) - Destination path if copying.[String]
) - Destination folder name if copying.Author: Adrian Andersson