Delen via


Work Flow Manager PowerShell does not return farm information when Work Flow Manager commands are executed

Issue Definition:

Work Flow Manager PowerShell does not return farm information when Work Flow Manager commands are executed.

Recently, we have observed a scenario when ‘Get-Wffarm’ command was executed on Work Flow Manager PowerShell, it returned no valid module file found error as per below.

Import-Module : The specified module 'WorkflowManager' was not loaded because no valid module file was found in any module directory.

At C:\Program Files\Workflow Manager\1.0\Scripts\ImportWorkflowModule.ps1:20 char:1

+ Import-Module WorkflowManager

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo          : ResourceUnavailable: (WorkflowManager:String) [Import-Module], FileNotFoundException

+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

The same error would be observed for all Work Flow Manager commands.

Cause:

This is not a Work Flow Manager issue. This issue occurs if PowerShell is upgraded which makes it to lose Work Flow Manager cmdlets that were installed as part of the WFM install.

Most common observation for PowerShell upgrade would be windows updates.

Solution:

The PowerShell updates could change the Environment Variable Values which were installed as part of Work Flow Manager installation. These values for PowerShell are found at ‘PSModulePath’ under ‘System Variables’ which are accessed from ‘Environment Variables’.

It would be easy to amend these values if there is a copy for reference. Please follow below steps to check for existing values and edit.

Step 1: Go to ‘System’ properties

blog119-1

Step 2: Under ‘Advanced’ tab, Click on ‘Environment Variables’ blog119-2

Step 3: Select ‘PSModulePath’ under ‘System variables’. Click on ‘Edit…’ blog119-3

Step 4: Check the environment variables in this tab. Either you would see the Work Flow Manager installation folder path is missing (like in below image) or amended. blog119-4

Step 5: Either you can add a ‘New’ variable or ‘Edit’ the existing variable. Please provide the installation folder path for Work Flow Manager. Click ‘OK’ blog119-5

Step 6: Launch Work Flow Manager PowerShell again to run the command ‘Get-Wffarm’ to make sure your output looks as per below. blog119-6

Written by

Sandeepkumar Pasumarthy
Microsoft GTSC