My script works fine and does changes as required. Only issue it does is my input file size remains same and output file keeps doubling. How can i stop that? Input is my orginal file!! when i compare i can see changes but my output ctg files gets doubled!! please help
$data = @(
@{
pattern = "LACTION 'SQL\(''logility_prod_scp_logility'',"
replacement = "LACTION 'SQL(''LOGILITY_PROD_SCP_LOGILITY'',"
inputFile = "C:\files\DW_FEI_input.ctg"
outputFile = "C:\files\DW_FEI_output.ctg"
},
@{
pattern = "LACTION 'SQL\(''dwfei'',"
replacement = "LACTION 'SQL(''DW_FEI'',"
inputFile = "C:\files\DW_FEI_input.ctg"
outputFile = "C:\files\DW_FEI_output.ctg"
},
@{
pattern = "LACTION 'SQL\(''DWFEI'',"
replacement = "LACTION 'SQL(''DW_FEI'',"
inputFile = "C:\files\DW_FEI_input.ctg"
outputFile = "C:\files\DW_FEI_output.ctg"
}
)
$data |
ForEach-Object {
(Get-Content $_.inputFile) -replace $_.pattern, $_.replacement | Out-File $_.outputFile
}