Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [cmdletbinding()]
- Param(
- [ValidateScript({Test-Path $_})]
- [ValidateNotNullOrEmpty()]
- [Parameter(Mandatory=$True)]
- [string]$filePath,
- [Parameter(Mandatory=$True)]
- [ValidateNotNullOrEmpty()]
- [string]$replace,
- [Parameter(Mandatory=$True)]
- [ValidateNotNullOrEmpty()]
- [string]$with
- )
- $content = Get-Content $filePath
- $updatedContent = $content -replace $replace, $with
- Set-Content -Path $filePath -Value $updatedContent
Add Comment
Please, Sign In to add comment