Hi!
- Is the "-replace" Parameter bounded to the cmdlet "Get-Content"? through googling i found it in many different contexts
- Why is the -replace Parameter not shown in the official Documentation? Get-Content Microsoft
Issue:
The text apporaches like this:olor sit amet, consetetur sadipscing elitr, sed diam nonumy LoremIpsum-648648sdfsd
I want to replace the substring via Regex from "LoremIpsum-xxx" to "Loremipsum"
This is my first Try:
(Get-Content "C:\File.cmd") -replace "[regex]::matches("LoremIpsum-(.*?)")" | Out-File -encoding ASCII C:\File.cmd
Get-Contentit's actually a comparison operator https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comparison_operators?view=powershell-7.2#replacement-with-regular-expressions