I want to split the path and just save the file name test.xls
in a new variable
$namearray = "C:\Users\z003m\Desktop\Service_Tickets\automationscript\vbs\Newfolder\test.xls"
Recommend using the built-in Split-Path
:
$newVariable = Split-Path $namearray -Leaf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With