I am attempting to replace part of a string and replace it with another.
Here is my string:
2/6/2020 3:46:22 PM - Server Name =>HHHHHHHHHAA01.nidy.state
I want to replace, "2/6/2020 3:46:22 PM - Server Name" with "Server Name"
Below is what I have so far and I stuck
$replace_space = Get-Content C:\Temp\Environment_Verification_NGDI\UAT27_a.txt -Encoding Ascii
$replace_space -replace '(?<=Server Name=").*?(?=")','Server Name' | Set-Content C:\Temp\Environment_Verification_NGDI\UATxx_b.txt
Open in new window