Get oldest filename from a directory
Get-OldestFile [[-path] <String>] [<CommonParameters>]
This function returns the oldest file of a folder. The parameter
filemask is specified with path and file mask.
Example 1:Returns the oldest text file from a folder #
PS C:\> Get-OldestFile -filemask 'C:\temp\*.txt'
# Output logo.txt
In this example the oldest text file from the folder
C:\temp is returned.
Specifies the path, including the file mask, for which the oldest file should be found.
Type: String Parameter Sets: (All) Aliases: Required: False Position: 0 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.