Answer the question
In order to leave comments, you need to log in
How to remove line breaks in PowerShell?
There is a small script
Get-WmiObject win32_computersystem name | select name -ExpandProperty Name | Out-File C:\Distrib\test.txt
$a=Get-Content C:\Distrib\test.txt
$b=$a.split('-')
$c=$b[$b.Length-1]
$c = $c | foreach {"S"+$_}
$c | Out-File C:\Distrib\test.txt
Answer the question
In order to leave comments, you need to log in
'S'+(Get-WmiObject win32_computersystem).Name.Split('-')[-1] |
Out-File C:\Distrib\conf.txt -NoNewline -Enc default
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question