當您使用 Set-SPPowerPointServiceApplication 命令時,遺漏參數的自變數

原始 KB 編號: 982964

癥狀

試想以下情況:

  • 您執行Microsoft Office Online 程式,以在伺服器上安裝 PowerPoint Services。 此伺服器正在執行 Microsoft SharePoint Server 2010 或 Microsoft SharePoint Foundation 2010。

  • 您可以在伺服器上啟動 SharePoint 2010 管理命令介面。 若要這樣做,請按兩下 [開始],按兩下 [ 所有程式],按兩下 [Microsoft SharePoint 2010],然後按兩下 [SharePoint 2010 管理命令介面]。

  • 您可以在主控台提示字元中輸入命令,該命令會使用下列其中一個參數 Set-SPPowerPointServiceApplication

    • DisableBinaryScan
    • EnableSandboxedEditing
    • EnableSandboxedViewing
    • EnableViewing97To2003Formats
    • EnableViewingOpenXmlFormats

例如,您可以輸入下列命令,以在執行 PowerPoint Services 的伺服器上檢視 PowerPoint Online OpenXML 格式的檔:

Get-SPPowerPointServiceApplication | Set-SPPowerPointServiceApplication -EnableViewingOpenXmlFormats

在此情況下會收到類似下列的錯誤訊息:

Set-SPPowerPointServiceApplication:缺少參數 'EnableViewingOpenXmlFormats' 的自變數。 指定類型為 'System.Boolean' 的參數,然後再試一次。
在行:1 char:101
+ Get-SPPowerPointServiceApplication |Set-SPPowerPointServiceApplication -EnableViewingOpenXmlFormats <<<<
+ CategoryInfo : InvalidArgument: (:) [Set-SPPowerPointServiceApplication], ParameterBindingException
+ FullyQualifiedErrorId : MissingArgument,Microsoft.Office.Server.Powerpoint.SharePoint.PowerShell.SetSPPowerPointServiceApplication

原因

發生此問題的原因是 Set-SPPowerPointServiceApplication 命令的參數需要單獨的 Boolean 引數,例如值 $true$false

解決辦法

若要解決此問題,請在使用 Set-SPPowerPointServiceApplication 命令時提供必要的自變數。

例如,輸入下列命令,以在執行 PowerPoint Services 的伺服器上檢視 PowerPoint Online OpenXML 格式的檔:

Get-SPPowerPointServiceApplication | Set-SPPowerPointServiceApplication -EnableViewingOpenXmlFormats:$true

詳細資訊

如需命令的詳細資訊 Set-SPPowerPointServiceApplication ,請參閱 Set-SPPowerPointServiceApplication