I tried but did not find an answer :
How do I get the current user home in Windows PowerShell?
In Windows, it looks like $env:userprofile or $env:homepath without the drive.
dir env: | where value -match admin
Name Value
---- -----
APPDATA C:\Users\admin\AppData\Roaming
HOMEPATH \Users\admin
LOCALAPPDATA C:\Users\admin\AppData\Local
OneDrive C:\Users\admin\OneDrive
Path C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Wind...
PSModulePath C:\Users\admin\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerSh...
TEMP C:\Users\admin\AppData\Local\Temp
TMP C:\Users\admin\AppData\Local\Temp
USERNAME admin
USERPROFILE C:\Users\admin