Compartilhar via


New-FsrmFmjCondition

New-FsrmFmjCondition

Creates a file management property condition object.

Syntax

Parameter Set: CreateFmjCondition0
New-FsrmFmjCondition [-Property] <String> [-Condition] <FmjConditionTypeEnum> [-AsJob] [-CimSession <CimSession[]> ] [-DateOffset <Int32> ] [-ThrottleLimit <Int32> ] [-Value <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The New-FsrmFmjCondition cmdlet creates a file management condition object. A file management condition object defines a condition that determines if a file management job acts on a file.

Parameters

-AsJob

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CimSession<CimSession[]>

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Aliases

Session

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Condition<FmjConditionTypeEnum>

Specifies the condition of the property that must be matched for the file management job. The acceptable values for this parameter are:
-- Equal
-- NotEqual
-- GreaterThan
-- LessThan
-- Contain
-- Exist
-- NotExist
-- StartWith
-- EndWith
-- ContainedIn
-- PrefixOf
-- SuffixOf
-- MatchesPattern

Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DateOffset<Int32>

Specifies an offset from the Value parameter for DateTime values. The default value is 0.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Property<String>

Specifies the property to compare for the condition. Specify one of the following values:
-- The name of a classification property definition on the server. (Do not specify the display name of the property definition.)
-- The string File.Name
-- The string File.DateCreated
-- The string File.DateLastModified
-- The string File.DateLastAccessed

The value of this parameter limits the values that other parameters to the cmdlet can accept as follows:

File.Name:
-- You can set the Condition parameter only to MatchesPattern.
-- The Value parameter must contain a semi-colon separated list of wildcard patterns.
-- You cannot specify the DateOffset parameter.

File.DateCreated, File.DateLastModified, or File.DateLastAccessed:
-- You can set the Condition parameter only to LessThan or Equal.
-- If you specify the DateOffset parameter, you can set the Value parameter to one of the following: File.DateCreated, File.DateLastModified, File.DateLastAccessed, or Date.Now.
-- If you do not specify the DateOffset parameter, you can set the Value parameter to a FileTime value.

The name of a classification property definition whose Type is DateTime:
-- You can set the Condition parameter to Exist, NotExist, Equal, NotEqual, LessThan, GreaterThan.
-- If you specify the DateOffset parameter, the Value parameter can contain one of the following: File.DateCreated, File.DateLastModified, File.DateLastAccessed, or Date.Now.
-- If you do not specify the DateOffset parameter, the Value parameter can contain a FileTime value.

The name of a classification property definition whose Type is not DateTime:
-- You cannot specify the DateOffset parameter.
-- If the Condition parameter is Exist or NotExist, you cannot specify the Value parameter.
-- If the Type is Integer, you can set the Condition parameter to Equal, NotEqual, Exist, NotExist, LessThan, GreaterThan.
-- If the Type is String, you can set the Condition parameter to Equal, NotEqual, Exist, NotExist, Contains, IsContainedIn, LessThan, GreaterThan, StartsWith, EndsWith, PrefixOf, SuffixOf.
-- If the Type is YesNo, you can set the Condition parameter to Equal, NotEqual, Exist, NotExist.
-- If the Type is OrderedList, you can set the Condition parameter to Equal, NotEqual, Exist, NotExist, LessThan, GreaterThan.
-- If the Type is SingleChoice, you can set the Condition parameter to Equal, NotEqual, Exist, NotExist.
-- If the Type is MultiChoice, you can set the Condition parameter to Equal, NotEqual, Exist, NotExist, Contains.
-- If the Type is MultiString, you can set the Condition parameter to Equal, NotEqual, Exist, NotExist, Contains.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ThrottleLimit<Int32>

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Value<String>

Specifies a name of a file condition property value. Do not specify this parameter if you specify Exists or NotExist for the Condition parameter. If you specify the name of a DateTime property, specify the DateOffset parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.Management.Infrastructure.CimInstance#MSFT_FSRMFMJCondition

Examples

Example 1: Create a property condition

This command creates a property condition that verifies that a file has a PII classification property set to true.

PS C:\> New-FsrmFmjCondition -Property "PII" -Condition Equal -Value "1"

Example 2: Create a condition based on a file classification

This command creates a condition based on the file’s classification. The command verifies that a file has a DatePublished classification property (of type DateTime) set to the file’s Last Modified timestamp.

PS C:\> New-FsrmFmjCondition -Property "DatePublished" -Condition Equal -Value "File.DateLastModified"

Get-FsrmClassificationPropertyDefinition