BigFix PowerShell Module v1.1 Released

Back in 2019 I announced the initial public release of my BigFix PowerShell Module enabling folks to leverage the BigFix API in a more PowerShell-friendly manner. After 2 years and almost 82k downloads, I have just officially released version 1.1 to the public.

Version 1.1 (pre-release) has actually been available on GitHub since May 2021 for those wanting to experience the latest-and-greatest. To the fine folks who followed along with the development, suggested improvements, and acted as my guinea pigs… I want to extend my personal and heartfelt thanks.

This release has several code optimizations that should result in a noticeable improvement in the parsing of result records, especially for large result sets, as well as some general improvements that should result in better stability and compatibility.

The biggest change however is the introduction of Client-Side Relevance Evaluation!

If you already have the BigFix Module installed, you can update it to version 1.1 simply by issuing the command:

Update-Module -Name BigFix

If you do not already have it installed, you can obtain it by opening a PowerShell window and issuing the command:

Install-Module -Name BigFix

Here is the updated section of the manual highlighting the new features:

Qna Session
Working with remote Web Reports Server(s) is great but sometimes you may want to evaluate client relevance directly on the computer you are currently connected to. This can be as simple as firing off simple relevance statements to obtain answers that would be otherwise more complicated to obtain, or as complex as building a full offline fixlet evaluation system to determine what fixlets the computer requires without requiring a network connection.

Each Qna Session is self-contained allowing you to create multiple sessions to either a single qna.exe binary (for parallel query executions), or to a totally different qna.exe binary (testing queries for consistent results across multiple versions).

New-QnaSession
Creates a new Qna Session object and expose it into the current scope. By default, it will attempt to link to the qna.exe utility application binary using the following search path order:

  1. Directory defined within the environmental variable ‘QnA’.
  2. Current working directory.
  3. Directory where the BigFix Client is registered
  4. Every directory defined within the environmental variable ‘PATH’, in the order it is defined.

If called with the -ExecutablePath parameter and provided with the full path of the qna.exe utility, the session will attempt to link to that binary.

Parameters
-ExecutablePath Path to the BigFix Qna utility executable (i.e. qna.exe)

Examples
Create a new Qna Session using the qna.exe utility application installed as part of the BigFix Client installation.

New-QnaSession

Output:

IdleTimeout EvaluationTimeout ExecutablePath Version
----------- ----------------- -------------- -------
300 60 C:\Program Files (x86)\BigFix Enterprise\BES Client\qna.exe 9.5.12.68

Create a new Qna Session using the qna.exe utility application at the provided path.

New-QnaSession -ExecutablePath 'C:\Tools\BigFix\qna.exe'

Output:

IdleTimeout EvaluationTimeout ExecutablePath Version
----------- ----------------- -------------- -------
300 60 C:\Tools\BigFix\qna.exe 9.5.15.71

Get-QnaSession
Gets the previously instantiated Qna Session object.

Examples

Get-QnaSession

Output:

IdleTimeout EvaluationTimeout ExecutablePath Version
----------- ----------------- -------------- -------
300 60 C:\Program Files (x86)\BigFix Enterprise\BES Client\qna.exe 9.5.12.68

Invoke-EvaluateClientRelevance
Evaluates Client Relevance statements in the established Qna Session, parsing results into a more PowerShell-friendly format. Relevance Statements can be provided via the -Relevance parameter or the pipeline. Results are returned sequentially to the pipeline as they are evaluated in the Qna Session.

Parameters
-Relevance Specifies the Client Relevance statement(s) to evaluate in the Qna Session.

-Session Specifies the Qna Session to evaluate the relevance in. If not provided, will attempt to use the last Qna Session created via New-QnaSession, creating a new Qna Session in the event none exists.

Examples
Evaluate the Client Relevance statement ‘computer name’.

Invoke-EvaluateClientRelevance -Relevance 'computer name'

Output:

Relevance Answer Error EvalTime
--------- ------ ----- --------
computer name {bigfix} 169

Evaluate the Client Relevance statements ‘now’ and ‘version of client’ using the pipeline for input.

'now','version of client' | Invoke-EvaluateClientRelevance

Output:

Relevance Answer Error EvalTime
--------- ------ ----- --------
now {Sun, 23 May 2021 15:52:15 -0400} 89
version of client {9.5.12.68} 695

Evaluate the Client Relevance statement ‘computer name’ using a specific Qna Session.

$QnaSession = New-QnaSession -ExecutablePath 'C:\Tools\BigFix\qna.exe'
Invoke-EvaluateClientRelevance -Relevance 'computer name' -Session $QnaSession

Output:

Relevance Answer Error EvalTime
--------- ------ ----- --------
computer name {bigfix} 188

5 Likes