Avatar of DevSupport
DevSupport
 asked on

splitting or cropping a variable value in powershell

Hi Experts,

In powershell I have a variable which has value

$var=C:\Tomcat8032_app\apache-tomcat\bin\tomcat8.exe //RS//dsupgdev

I want to crop this string and store the value to another variable such that I want only the values until 3rd backslash "\"

$new-var=C:\Tomcat8032_app\apache-tomcat\

Could you please help me with this?
Powershell

Avatar of undefined
Last Comment
Shaun Vermaak

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Shaun Vermaak

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
DevSupport

ASKER
Thank You Shaun!!
Shaun Vermaak

Anytime, happy to help

Please remember to Endorse my, or any other expert's, comment that you found helpful.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes