We help IT Professionals succeed at work.
Get Started

Redact powershell output

Rich Rumble
Rich Rumble asked
on
181 Views
Last Modified: 2016-03-31
I'd like to change every 3-4, 7-8, 11-12, 15-16... character in a line of output into two X's.
abcdefghijklmnopqrstuvwxyz  -->abXXefXXijXXmnXXqrXXuvXXyz
Get-CimInstance Win32_OperatingSystem |FL
SystemDirectory : C:\windows\system32
Organization    : Example.com
BuildNumber     : 7601
RegisteredUser  : Example User
SerialNumber    : 00392-918-5000002-888888
Version         : 6.1.7601
Becomes:

Get-CimInstance Win32_OperatingSystem |FL

SystemDirectory : C:XXinXXwsXXysXXm3X
Organization    : ExXXplXXcoXX
BuildNumber     : 76XX
RegisteredUser  : ExXXplXXUsXX
SerialNumber    : 00XX2-XX8-XX00XX2-XX88XX
Version         : 6.XX76XX
It seems simple, but the solution is eluding me.
-rich
Comment
Watch Question
CERTIFIED EXPERT
Top Expert 2014
Commented:
This problem has been solved!
Unlock 1 Answer and 10 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE