A Unix Person's Guide to PowerShell
  • ReadMe
  • About this Book
  • Introduction to PowerShell for Unix People
  • Commands Summary
  • Command Detail - A
  • Command Detail - B
  • Command Detail - C
  • Command Detail - D
  • Command Detail - E
  • Command Detail - F
  • Command Detail - G
  • Command Detail - H
  • Command Detail - I
  • Command Detail - J
  • Command Detail - K
  • Command Detail - L
  • Command Detail - M
  • Command Detail - N
  • Command Detail - O
  • Command Detail - P
  • Command Detail - Q
  • Command Detail - R
  • Command Detail - S
  • Command Detail - T
  • Command Detail - U
  • Command Detail - V
  • Command Detail - W
  • Command Detail - X
  • Command Detail - Y
  • Command Detail - Z
  • Command Detail - Non-alphabetical
  • To-do
Powered by GitBook
On this page

Command Detail - B

PreviousCommand Detail - ANextCommand Detail - C

Last updated 7 years ago

basename

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

Power Tips of the Day - Useful Path Manipulations Shortcuts