I been trying to figure out how to do the following in PowerShell but without much luck.
I want to replace everything between messageid> AND </messageid with the current date and time.
I have started writing some code as pasted below, can someone direct me in the right path - much appreciate it.
Get-Content -path C:\test.txt -raw -replace pattern = "(?s)messageid>(.*?)</messageid"'<message>*</messageid>' (Get-Date).ToString('dddd dd-MM-yyyy HH:mm:ss') | Set-Content -path c:\test.txt