<string[]> -match <regular-expression> <string[]> -notmatch <regular-expression> 當這些運算子的輸入是純量值時,它們會傳回
有关详细信息,请参阅about_Comparison_Operators。 逻辑运算符 使用逻辑运算符 (-and、-or、、-xor-not!、) 将条件语句连接到单个复杂条件中。 例如,可以使用逻辑-and运算符创建具有两个不同条件的对象筛选器。 有关详细信息,请参阅about_Logical_Operators。
信息,请参阅 about_comparison_operators。 $MyInvocation 包含一个对象,该对象具有有关当前命令(如脚本、函数或脚本块)的信息。可以使用该对象中的 信息(如脚本的路径和文件名 ($myinvocation.mycommand.path) 或函数的名称 ($myinvocation.mycommand.name))来标识当前命令。对于查找正在运行的脚本的名称,这非常有...
The-matchand-cmatchoperators, which compare a string to a regular expression. PowerShell also contains many operators that reverse the logic of the comparison, such as-notlikeand-notin. You can make comparisons directly at the command prompt, which returns either True or Fa...
"System.Int64". Error: "Input string was not in a correct format "System.Object[]" "telnet" connection test to different servers on different ports "Unable to find a default server with Active Directory Web Services running" when calling a script with Import-module AD "Unable to process the...
ComparisonOperator is an OPATH comparison operator (for example-eqfor equals and-likefor string comparison). For more information about comparison operators, seeabout_Comparison_Operators. Value is the property value to search for. Enclose text values and variables in single quotation marks ('Value'...
ComparisonOperator is an OPATH comparison operator (for example-eqfor equals and-likefor string comparison). For more information about comparison operators, seeabout_Comparison_Operators. Value is the property value to search for. Enclose text values and variables in single quotation marks ('Value'...
有关-match 运算符的详细信息,请参阅 about_Comparison_Operators。 有关正则表达式的详细信息,请参阅 about_Regular_Expressions。 $Matches 变量也适用于具有 switch 参数的 -Regex 语句。 其填充方式与 -match 和-notmatch 运算符相同。 有关 switch 语句的详细信息,请参阅 about_Switch。 备注 在会话中填充 ...
请务必了解<result-to-be-matched>值位于比较表达式的左侧。 这意味着<test-expression>的结果位于右侧,可以转换为左侧值的类型进行比较。 有关详细信息,请参阅about_Comparison_Operators 值default是为没有其他匹配项时使用的操作保留的。 $_自动变量包含传递给switch语句的表达式的值,可在<result-to-be-matched>语...
This article helps you in understanding -eq, -ceq, -ieq Comparison operators in Windows PowerShell which is used for comparison purpose. The usage examples of PowerShell -eq operator in this article gives a better understanding of its usage. Windows Powe