Skip to content

Instantly share code, notes, and snippets.

@matt40k
Last active December 22, 2015 11:36
Show Gist options
  • Save matt40k/a801c88313561b985415 to your computer and use it in GitHub Desktop.
Save matt40k/a801c88313561b985415 to your computer and use it in GitHub Desktop.
Update SSIS package with a new var name or such
$dtsFiles = Get-ChildItem "C:\GIT\BusinessIntelligence\" -Filter *.dts
Foreach($dtsFile in $dtsFiles)
{
Write-Host $dtsFile.FullName
$dtsContents = Get-Content $dtsFile.FullName
$dtsContents = $dtsContents -replace "audit.USP_ErrorLog", "[Audit].[USP_ErrorLog]"
$dtsContents = $dtsContents -replace "audit.USP_JobLog", "[Audit].[USP_JobLog]"
$dtsContents = $dtsContents -replace "audit.USP_RunTableRowCounts", "[Audit].[USP_RunTableRowCounts]"
$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