问题描述
我正在尝试使用 PowerShell DSC 在 Windows 2012 R2 服务器上自动安装 AppFabric 1.1.这实际上是我尝试自动化 SharePoint Foundation 安装和配置的一部分,但 AppFabric 1.1 是先决条件.下面是我的 DSC 配置脚本中的一个片段:
I'm trying to automate the installation of AppFabric 1.1 on a Windows 2012 R2 server using PowerShell DSC. This is actually part of me trying to automate the SharePoint Foundation install and configuration, but AppFabric 1.1 is a pre-requisite. Below is a snippit from my DSC config script:
Script InstallSharePointPreRequisites
{
GetScript = { Return "InstallSharePointPreRequisites" }
TestScript = {$false}
SetScript = {
Start-Process -FilePath 'c:\temp\SharePoint\pre\MicrosoftIdentityExtensions-64.msi' -ArgumentList '/qn' -Wait | Write-verbose
Start-Process -FilePath 'c:\temp\SharePoint\pre\setup_msipc_x64.msi' -ArgumentList '/qn' -Wait | Write-verbose
Start-Process -FilePath 'c:\temp\SharePoint\pre\sqlncli.msi' -ArgumentList '/qn' -Wait | Write-verbose
Start-Process -FilePath 'c:\temp\SharePoint\pre\Synchronization.msi' -ArgumentList '/qn' -Wait | Write-verbose
Start-Process -FilePath 'c:\temp\SharePoint\pre\WcfDataServices.exe' -ArgumentList '/quiet' -Wait | Write-verbose
Start-Process -FilePath 'c:\temp\SharePoint\pre\appfabric\setup.exe' -ArgumentList '/i cacheclient","cachingService","CacheAdmin /gac /l c:\temp\appfabric.log' -Wait | Write-verbose
Start-Process -FilePath 'c:\temp\SharePoint\pre\AppFabric1.1-RTM-KB2671763-x64-ENU.exe' -ArgumentList '/quiet' -Wait | Write-verbose
}
DependsOn = "[File]GetSharePointFiles"
}
我知道....TestScript = $false"是错误的形式,但我只是想让安装在这一点上运行.:)
I know....the "TestScript = $false" is bad form, but I'm just trying to get the install to run at this point. :)
无论如何,当 DSC 运行到 appfabric\setup.exe 时,它会抛出以下异常:
Anyway, when the DSC run get to the appfabric\setup.exe it's throwing the following exception:
"{"当应用程序未在 UserInteractive 模式下运行时显示模式对话框或表单不是有效操作.指定 ServiceNotification 或 DefaultDesktopOnly 样式以显示来自服务应用程序的通知."}"
"{"Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application."}"
当我从正常的 PS 提示运行 Start-Process 行时,它安装正常并且不显示可见的模式对话框.我还尝试将 AppFabric 设置 EXE 与具有相同结果的类似开关一起使用.我有点不知所措.有没有其他人能够使用 PowerShell DSC 安装 AppFabric 1.1?还是 SharePoint Foundation 2013?如果是这样,如何?我还没有找到关于这个场景的好的文档.
When I run the Start-Process line from a normal PS prompt it installs fine and doesn't show a visible modal dialog box. I've also tried using the AppFabric setup EXE with similar switches with the same result. I'm sort of at a loss here. Has anyone else been able to install AppFabric 1.1 using PowerShell DSC? Or SharePoint Foundation 2013 for that matter? If so, how? I haven't been able to find good documentation on this scenario yet.
谢谢,一个
推荐答案
我解决了这个问题.首先,我的脚本中有一个错字.应用结构设置行具有 CachAdmin
而不是 CacheAdmin
(在 cache 中缺少e").我花了一些时间,又写了几次才弄明白.设置好之后就安装好了.该死的,老眼睛和胖手指……谢谢你的关注.:)
I solved this problem. First, there was a typo in my script. The app fabric setup line had CachAdmin
rather than CacheAdmin
(was missing the 'e' in cache). It took me some time and writing it a few more times to figure that out. After setting that, it is installing fine. Darn, old eyes and fat fingers... Thanks for looking. :)
A
这篇关于使用 PowerShell DSC 安装 AppFabric 1.1 会导致模式对话框错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!