Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PowerShell script to load Jurisdiction data into GNAF
Param(
[string]$serverName,
[string]$databaseName,
[string]$jurisdictionFilesPath,
[string]$jurisdictionName
)
$filter = $jurisdictionName+"_*.psv"
Get-ChildItem $jurisdictionFilesPath -Filter $filter |
Foreach-Object {
$tableName = $_.name.Replace($jurisdictionName+"_", "").Replace("_psv.psv", "")
write-host "Procesing" $_.Name "into table" $tableName
bcp $tableName in $_.FullName -d $databaseName -S $serverName -t"|" -c -T -F 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.