2. Dezember 2014 16:29
function CompileNAV70
{
[CmdletBinding()]param (
[String]$WorkingFolder,
[String]$Server,
[String]$Database,
[String]$Filter
)
$LogFile = "$WorkingFolder\$Server\$Database\navcommandresult.txt"
if (Test-Path "$LogFile\navcommandresult.txt") {Remove-Item "$LogFile\navcommandresult.txt"}
$NAVFolder = '"C:\Program Files (x86)\Microsoft Dynamics NAV\70\RoleTailored Client'
$compilefinsqlcommand = """$NAVFolder\finsql.exe"" command=compileobjects,servername=$Server,database=$Database,logfile=$LogFile"
if ($Filter -ne ""){$compilefinsqlcommand = "$compilefinsqlcommand,filter=$Filter"}
$Command = $compilefinsqlcommand
Write-Debug $Command
cmd /c $Command
}
function CompileNAV71
{
[CmdletBinding()]param (
[String]$WorkingFolder,
[String]$Server,
[String]$Database,
[String]$Filter
)
$LogFile = "$WorkingFolder\$Server\$Database\navcommandresult.txt"
if (Test-Path "$LogFile\navcommandresult.txt") {Remove-Item "$LogFile\navcommandresult.txt"}
$NAVFolder = '"C:\Program Files (x86)\Microsoft Dynamics NAV\71\RoleTailored Client'
$compilefinsqlcommand = """$NAVFolder\finsql.exe"" command=compileobjects,servername=$Server,database=$Database,logfile=$LogFile"
if ($Filter -ne ""){$compilefinsqlcommand = "$compilefinsqlcommand,filter=$Filter"}
$Command = $compilefinsqlcommand
Write-Debug $Command
cmd /c $Command
}
CompileNAV71 `
-WorkingFolder '<MyLogFilePath>' `
-Server '<MyServerName>' `
-Database '<MyDatabaseName>' `
-Filter 'Version List="<MyFilter>"'
CompileNAV80 `
-WorkingFolder '<MyLogFilePath>' `
-Server '<MyServerName>' `
-Database '<MyDatabaseName>' `
-Filter 'Version List="<MyFilter>"' `
-Synchronize 'No'
function CompileNAV80
{
[CmdletBinding()]param (
[String]$WorkingFolder,
[String]$Server,
[String]$Database,
[String]$Filter,
[String]$Synchronize
)
$LogFile = "$WorkingFolder\$Server\$Database\navcommandresult.txt"
if (Test-Path "$LogFile\navcommandresult.txt") {Remove-Item "$LogFile\navcommandresult.txt"}
$NAVFolder = '"C:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client'
$compilefinsqlcommand = """$NAVFolder\finsql.exe"" command=compileobjects,servername=$Server,database=$Database,logfile=$LogFile,synchronizeschemachanges=$Synchronize"
if ($Filter -ne ""){$compilefinsqlcommand = "$compilefinsqlcommand,filter=$Filter"}
$Command = $compilefinsqlcommand
Write-Debug $Command
cmd /c $Command
}