Powershell Variable trimming


geeks,

im trying trim below string unable acheive-

$string = "\\winfile01\d$\share01\2016\may\dept"

i $string trimmed , saved value "dept" stored in variable.

i tried various trim functions, not able want.

let me know how proceed it.


cheers, alan.

hi alan,

try this:

$leaf = split-path $string -leaf $leaf

cheers,
fred


there's no place 127.0.0.1



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Group Policy Event ID 1058 Error Code 1326 (The user name or password is incorrect)

Suspicious event log Event ID: 4905

DCOM received error "2147746132" from...