PackageDeployment Module Help

Package Deployment Module

Read-WmiObjectCount Cmdlet

Version 2.1.0.0

Read-WmiObjectCount

Synopsis

Save Number of Instances of a Class in a Variable

Syntax

Read-WmiObjectCount [-Namespace] <String> [-Class] <String> [-ResultVariable] <String> [-ContinueOnError] [[-Context] <String>] [<CommonParameters>]

Description

Use this command to query the number of available system and software components via WBEM/WMI.

Parameters

-Class <String>

The relative path within the namespace which corresponds to the class names, for which you need to determine the number of present instances on the system.

Required

True

Position

1

Accepts pipeline input

False

-Context <String>

User: Execution under user account; logging in HKEY_CURRENT_USER, i.e. for the user.
UserPerService: User-related command, execution in Service context.
Computer: Execution under user account; logging in HKEY_CURRENT_MACHINE, i.e. for the computer.
ComputerPerService: Execution in service context; logging in HKEY_LOCAL_MACHINE, i.e. for the computer.

Required

False

Position

3

Accepts pipeline input

False

-ContinueOnError <SwitchParameter>

Continues script execution in spite of errors in the respective command

Required

False

Position

Named

Accepts pipeline input

False

-Namespace <String>

Enter the Namespace to which the object should be connected and in which the class (object) is located.

Required

True

Position

0

Accepts pipeline input

False

-ResultVariable <String>

The variable which contains the number of found instances following execution of the command.

Required

True

Position

2

Accepts pipeline input

False

<CommonParameters>

For more information about common parameters, type "Get-Help about_CommonParameters".