Skip to content

Instantly share code, notes, and snippets.

@Hugoberry

Hugoberry/UserNameNTFS.m

Last active Sep 5, 2020
Embed
What would you like to do?
Power Query get current USERNAME via NTFS route
//Assumes current user is the one with latest [Date accessed] folder in C:\Users
let
Users = Folder.Contents("C:/Users"),
CurrentUser = Table.FirstN(Table.Sort(Users,{{"Date accessed", Order.Descending}}),1)[Name]{0}
in
CurrentUser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.