Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

"The 'finally' keyword is not supported" error in CheckMaxConcurrentAPI.ps1 in SCOM 2007 R2


View products that this article applies to.

Symptoms

When the CheckMaxConcurrentAPI.ps1 Windows PowerShell script fails in Microsoft System Center Operations Manager (SCOM) 2007 R2, the MaxConCurrentAPI monitor generates an error message that resembles the following:

The PowerShell script failed with below exception
System.Management.Automation.ParseException: The 'finally' keyword is not supported in this version of the language.

At line:148 char:8

+ finally
<<<<{
at System.Management.Automation.Parser.finallyStatementRule(Tokenizer tok)
at System.Management.Automation.Parser.statementRule(Tokenizer tok)

at System.Management.Automation.Parser.statementListRule(Tokenizer tok)

at System.Management.Automation.Parser.cmdletBodyRule(Tokenizer tok, Token fnName, Boolean isFilter, ParameterDeclarationNode parameters, Boolean scriptMode)

at System.Management.Automation.Parser.functionDeclarationRule(Tokenizer tok)

at System.Management.Automation.Parser.statementRule(Tokenizer tok)

at System.Management.Automation.Parser.statementListRule(Tokenizer tok)

at System.Management.Automation.Parser.Parse(String input, Int32 cursorPosition)

at System.Management.Automation.AutomationEngine.Parse(String script, Boolean interactiveCommand)

at System.Management.Automation.ShellFunctionCommandProcessor..ctor(String script, ExecutionContext context, Boolean isFilter, Boolean useLocalScope, Boolean interactiveCommand)

at System.Management.Automation.Runspaces.Command.CreateCommandProcessor(ExecutionContext executionContext, CommandFactory commandFactory, Boolean addToHistory)

at System.Management.Automation.Runspaces.LocalPipeline.CreatePipelineProcessor()

at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()

at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()

Script Name: CheckMaxConcurrentAPI.ps1


One or more workflows were affected by this.

Workflow name: Microsoft.Windows.Server.2008.MaxConcurrentAPI.Monitor

Instance name: Microsoft Windows Server 2008 Standard without Hyper-V
Instance ID: <Instance ID>
Management group: <MG name>
Note This issue occurs after you import the System Center Management Pack for Windows Server Operating System version 6.0.7026.0 into a System Center Operations Manager 2007 R2 management group.

↑ Back to the top


Cause

This issue occurs because System Center Operations Manager 2007 R2 and its management pack use a version of Windows PowerShell 2.0 that doesn’t support the "finally" keyword.

↑ Back to the top


Workaround

To work around this issue without installing the Windows PowerShell 2.0 update, use one of the following methods: 

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 2856250
Revision : 1
Created on : 1/7/2017
Published on : 9/27/2013
Exists online : False
Views : 459