Created
February 21, 2016 19:39
-
-
Save matt40k/7b2061b2c00d309f5f5b to your computer and use it in GitHub Desktop.
Update SSIS package prefixes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$dtsFiles = Get-ChildItem "C:\GIT\BusinessIntelligence\" -Filter *.dts -Recurse | |
Foreach($dtsFile in $dtsFiles) | |
{ | |
Write-Host $dtsFile.FullName | |
$dtsContents = Get-Content $dtsFile.FullName | |
$dtsContents = $dtsContents -replace "SEQC_", "(SEQC) " | |
$dtsContents = $dtsContents -replace "SEQC - ", "(SEQC) " | |
$dtsContents = $dtsContents -replace "DFT_", "(DFT) " | |
$dtsContents = $dtsContents -replace "EXEC_", "(EXEC) " | |
$dtsContents = $dtsContents -replace "LKP_", "(LKP) " | |
$dtsContents = $dtsContents -replace "CNT_", "(CNT) " | |
$dtsContents = $dtsContents -replace "OLE_SRC_", "(OLE_SRC) " | |
$dtsContents = $dtsContents -replace "OLE_DST_", "(OLE_DST) " | |
$result = Set-Content $dtsFile.FullName $dtsContents -Encoding UTF8 # Need to set the encoding as PowerShell didn't honour the original and the (C) caused diff changes (and prob errors | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment