4. Dezember 2014 16:51
function ImportObjectsNAV70
{
[CmdletBinding()]param (
[String]$WorkingFolder,
[String]$Server,
[String]$Database,
[String]$ImportFile,
[String]$ImportAction
)
$ImportFile = $ImportFile.Trim("""")
$LogFile = "$WorkingFolder\$Server\$Database\navcommandresult.txt"
if (Test-Path "$LogFile\navcommandresult.txt") {Remove-Item "$LogFile\navcommandresult.txt"}
if ($ObjectFile -ne "")
{
$NAVFolder = 'C:\Program Files (x86)\Microsoft Dynamics NAV\70\RoleTailored Client'
$importfinsqlcommand = """$NAVFolder\finsql.exe"" command=importobjects, file=$ImportFile, servername=$Server, database=$Database,importAction=$ImportAction,logfile=$LogFile"
$Command = $importfinsqlcommand
Write-Debug $Command
cmd /c $Command
}
}
function ImportObjectsNAV71
{
[CmdletBinding()]param (
[String]$WorkingFolder,
[String]$Server,
[String]$Database,
[String]$ImportFile,
[String]$ImportAction
)
$ImportFile = $ImportFile.Trim("""")
$LogFile = "$WorkingFolder\$Server\$Database\navcommandresult.txt"
if (Test-Path "$LogFile\navcommandresult.txt") {Remove-Item "$LogFile\navcommandresult.txt"}
if ($ObjectFile -ne "")
{
$NAVFolder = 'C:\Program Files (x86)\Microsoft Dynamics NAV\71\RoleTailored Client'
$importfinsqlcommand = """$NAVFolder\finsql.exe"" command=importobjects, file=$ImportFile, servername=$Server, database=$Database,importAction=$ImportAction,logfile=$LogFile"
$Command = $importfinsqlcommand
Write-Debug $Command
cmd /c $Command
}
}
function ImportObjectsNAV80
{
[CmdletBinding()]param (
[String]$WorkingFolder,
[String]$Server,
[String]$Database,
[String]$ImportFile,
[String]$ImportAction,
[String]$Synchronize
)
$ImportFile = $ImportFile.Trim("""")
$LogFile = "$WorkingFolder\$Server\$Database\navcommandresult.txt"
if (Test-Path "$LogFile\navcommandresult.txt") {Remove-Item "$LogFile\navcommandresult.txt"}
if ($ObjectFile -ne "")
{
$NAVFolder = 'C:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client'
$importfinsqlcommand = """$NAVFolder\finsql.exe"" command=importobjects,file=$ImportFile,servername=$Server,database=$Database,importAction=$ImportAction,synchronizeschemachanges=$Synchronize,logfile=$LogFile"
$Command = $importfinsqlcommand
Write-Debug $Command
cmd /c $Command
}
}