New-FsrmFmjCondition
Creates a file management property condition object.
Syntax
Default (Default)
New-FsrmFmjCondition
[-Property] <String>
[-Condition] <FmjConditionTypeEnum>
[-Value <String>]
[-DateOffset <Int32>]
[-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>]
[-AsJob]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
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.
Examples
Example 1: Create a property condition
PS C:\> New-FsrmFmjCondition -Property "PII" -Condition Equal -Value "1"
This command creates a property condition that verifies that a file has a PII classification property set to true.
Example 2: Create a condition based on a file classification
PS C:\> New-FsrmFmjCondition -Property "DatePublished" -Condition Equal -Value "File.DateLastModified"
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.
Parameters
-AsJob
Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.
The cmdlet immediately returns an object that represents the job and then displays the command prompt.
You can continue to work in the session while the job completes.
To manage the job, use the *-Job
cmdlets.
To get the job results, use the Receive-Job cmdlet.
For more information about Windows PowerShell background jobs, see about_Jobs.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-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.
Parameter properties
Type: | CimSession[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | Session |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Condition
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
Parameter properties
Type: | FmjConditionTypeEnum |
Default value: | None |
Accepted values: | Equal, NotEqual, GreaterThan, LessThan, Contain, Exist, NotExist, StartWith, EndWith, ContainedIn, PrefixOf, SuffixOf, MatchesPattern |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | 2 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: | SwitchParameter |
Default value: | False |
Supports wildcards: | False |
DontShow: | False |
Aliases: | cf |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-DateOffset
Specifies an offset from the Value parameter for DateTime values. The default value is 0.
Parameter properties
Type: | Int32 |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-Property
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.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | 1 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-ThrottleLimit
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.
Parameter properties
Type: | Int32 |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Value
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.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
Type: | SwitchParameter |
Default value: | False |
Supports wildcards: | False |
DontShow: | False |
Aliases: | wi |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.