2014-10-31 76 views
0

我試圖通過非交互模式下的powershell執行axbuild.exe(動態AX的新64位編譯器),它加載第一個屏幕,但過程結束。axbuild.exe nonInteractive | AX 2012 R3

從windows命令行運行時,第一個屏幕打開,關閉,幾秒鐘後,大量工作進程產生並處理整個X ++編譯。

任何想法??建議?

回答

0

您必須以提升的權限運行axbuild.exe(以管理員身份運行)。

如果你開始從任務計劃主叫過程你必須勾選使用最高權限選項運行。

Task Scheduler - Run with highest privileges


內可以執行Start-Process AxBuild.exe -Verb RunAs PowerShell的。

您可以驗證管理員特權與下面的代碼片段:

([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") 

PowerShell: Running a command as Administrator例如。

+0

我在TeamCity的運行此,它需要額外的東西嗎?它正在執行以下操作: 開始:C:\ Windows \ System32 \ WindowsPowerShell \ v1.0 \ powershell.exe -NonInteractive -ExecutionPolicy Bypass -File「C:\ Program Files(x86)\ TeamCity \ buildAgent \ temp \ buildTmp \ powershell2280810545960782468.ps1「 – silvanod 2014-11-01 12:13:58

+0

當我在同一臺機器上使用-Verb RunAs在同一臺機器上手動運行它時,同樣的腳本效果很好。但即使在腳本中使用了額外的開關,在通過TeamCity運行時也不會起作用。 – silvanod 2014-11-01 12:14:52

1

我一直有與Start-Process煩惱(使用提升的權限),但最近我切換到&命令,它運行就像一個魅力,是這樣的:

$axBuild = Join-Path $axServerBin "\AxBuild.exe" 
$axCompiler = Join-Path $axServerBin "\ax32serv.exe" 
& $axBuild 'xppcompileall' /compiler="$axCompiler" /log="$scriptPath" /altbin="$axClientbin"