I want to pass a function call(which returns a string) as a replacement string to Powershell\'s replace function such that each match found is replaced with a different stri
PowerShell does not (yet?) have support for passing a script block to the -replace operator. The only option here is to use [Regex]::Replace directly:
-replace
[Regex]::Replace
[Regex]::Replace($mystring, 'match', {callback})