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:
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