Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

徵狀

假設您在針對 Microsoft SQL Server 2012 Analysis Services (SSAS 2012)或 SQL Server 2014 Analysis Services (SSAS 2014)處理的 SQL Server Management Studio (SSMS)中使用 AsCmd Cmdlet 與 POWERSHELL 和 XML for ANALYSIS (XMLA)。 在這種情況下,您會遇到下列針對傳回的輸出所產生的行為差異:

  • 當您使用下列 PowerShell 命令來捕獲警告訊息時:Invoke-Ascmd -InputFile:"<input.xmla>" -Server:"<servername>" -OutVariable out -WarningVariable w 如果命令收到任何警告訊息,就不會在傳回代碼中捕獲警告訊息。 不過,如果您從 SSMS 執行相同的 XMLA 命令,就會捕獲警告訊息。

  • 當您使用下列 PowerShell 命令來捕獲錯誤訊息時:Invoke-Ascmd -InputFile: :"<input.xmla>" -Server:"<servername>" -ErrorVariable e -OutVariable out -WarningVariable w 如果命令收到任何錯誤訊息,則錯誤訊息會包含在 警告 標記中,但不會在傳回代碼中捕獲。 不過,如果您從 SSMS 執行相同的 XMLA 命令,錯誤訊息會包含在 錯誤 標記中並捕獲到傳回碼中。

原因

之所以會發生這個問題,是因為 AsCmd Cmdlet 會忽略警告訊息,但會捕獲錯誤訊息,並使用錯誤的範本來產生傳回輸出。

每個新的 SQL Server 累計更新都包含所有的修正程式,以及前一個累積更新中所包含的所有安全性修正程式。 查看 SQL Server 的最新累計更新:

狀態

Microsoft 已確認本篇文章<適用於>一節所列之 Microsoft 產品確實有上述問題。

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×