Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 1.18 KB

Update-StringInFile.README.md

File metadata and controls

34 lines (24 loc) · 1.18 KB

Update-StringInFile

Replace a string in one or multiple files.

Description

Replace a string in one or multiple files. Binary files (*.zip, *.exe, etc.) are not touched by this script.

Screenshot

Syntax

Update-StringInFile [-Path] <String> [-Find] <String> [-Replace] <String> [[-CaseSensitive]] [<CommonParameters>]

Example 1

PS> Update-StringInFile -Path E:\Temp\Files\ -Find "Test1" -Replace "Test2" -Verbose
       
VERBOSE: Binary files like (*.zip, *.exe, etc...) are ignored
VERBOSE: Total files with string to replace found: 3
VERBOSE: Current file: E:\Temp\Files\File_01.txt
VERBOSE: Number of strings to replace in current file: 1
VERBOSE: Current file: E:\Temp\Files\File_02.txt
VERBOSE: Number of strings to replace in current file: 1
VERBOSE: Current file: E:\Temp\Files\File_03.txt
VERBOSE: Number of strings to replace in current file: 2