variables - Why does this work (or how)? -
in email today received email getting unused drive letters. this solution:
get-childitem function:[d-z]: -name | where-object {-not (test-path -path $_)}
powershell magazine brainteaser had solution, same thing.
ls function:[d-z]: -n|?{!(test-path $_)}|random
i have no idea how function:[d-z]:
works. know each character between 'd' 'z' used don't know why syntax works.
testing get-childitem function:[d-a]: -name
gives error saying get-childitem : cannot retrieve dynamic parameters cmdlet. specified wildcard pattern not valid:[d-a]:
so dynamic parameter? how come not show get-help gci -full
?
function:
psdrive exposes set of functions defined in current session. powershell creates function each single letter drive, named letter followed colon.
so, function:[d-z]:
lists functions "d:" through "z:"
function:[d-a]:
doesn't work because , d-a isn't range of letters.
Comments
Post a Comment