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

DCOM received error "2147746132" from...

DFSR RPC replication errors 5014 1726 with large files over VPN

ADFS 3.0 Event ID 4625 | An Error occurred During Logon | Status: 0xC000035B