Forum Discussion
Optional options as nullable record
- 6 years ago
You can get a little more info by using #shared as your source in a blank query. Convert that to a table and then filter to and click on the function of interest. In the case of Folder.Files(), the optional parameter is "PreserveLastAccessTimes" and accepts true or false.
Here is the query I used to get to this function, if you want to see for yourself.
let
Source = #shared,
#"Converted to Table" = Record.ToTable(Source),
#"Filtered Rows" = Table.SelectRows(#"Converted to Table", each ([Name] = "Folder.Contents" or [Name] = "Folder.Files")),
Value = #"Filtered Rows"{1}[Value]
in
ValueRegards,
Pat
SOmething I tried to create
Better to have some kind of option to allow include subdirs content
something like -Recurse in powershell Get-ChildItem have
(path as text) as table =>
let
Source = Folder.Contents(path),
// Source{[Name="Aiseesoft Studio"]}[Attributes][Directory]
Folders = Table.SelectRows(Source, each ([Attributes][Directory] = true)),
Step1 = Table.SelectColumns(Folders,{"Name", "Folder Path"}),
Step2 = Table.AddColumn(Step1, "DirContent", each DirContent([Folder Path]& [Name])),
Step3 = Table.RemoveColumns(Step2,{"Folder Path", "Name"}),
Expanded = Table.ExpandTableColumn(Step3, "DirContent", {"Content", "Name", "Extension", "Date accessed", "Date modified", "Date created", "Attributes", "Folder Path"}, {"Content", "Name", "Extension", "Date accessed", "Date modified", "Date created", "Attributes", "Folder Path"}),
Files = Table.SelectRows(Source, each ([Attributes][Directory] = false)),
Result = Table.Combine({Files,Expanded})
in
Result