Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

How do I pull part of a variable in Powershell

$
0
0

Hello, if I use the $env:computername to get a computer name, I will need to pull just a part of the variable to create a new variable

Here is an example:

If the return is BBUS1000-01 I need to set a variable from that result to = US1000 for further scripting.

i.e $BRIN = (the part of the $env:computername) which in this case would = US1000

Thank You!
Paul


Duramaxster


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>