Last updated 7 years ago
A rough PowerShell equivalent for the unix basename is:
dir <whatever> | select name
This depends on the file actually existing, whereas basename doesn't care.
A more precise (but perhaps less concise) alternative[1] is:
Notes [1] I found [System.IO.Path]::GetFileName after reading , which has some other useful commands
[System.IO.Path]::GetFileName