[{"data":1,"prerenderedAt":811},["ShallowReactive",2],{"navigation_docs_zh_tw":3,"-zh-tw-pml-2-plugin-operators":75,"-zh-tw-pml-2-plugin-operators-surround":806},[4,26],{"title":5,"path":6,"stem":7,"children":8,"page":25},"PML 2 外掛開發指南","\u002Fzh_tw\u002Fpml-2-plugin","zh_tw\u002Fpml-2-plugin",[9,13,17,21],{"title":10,"path":11,"stem":12},"外掛開發綜述","\u002Fzh_tw\u002Fpml-2-plugin\u002Fintro","zh_tw\u002Fpml-2-plugin\u002F01.intro",{"title":14,"path":15,"stem":16},"外掛系統觸發點說明","\u002Fzh_tw\u002Fpml-2-plugin\u002Ftriggers","zh_tw\u002Fpml-2-plugin\u002F02.triggers",{"title":18,"path":19,"stem":20},"外掛系統運算子說明","\u002Fzh_tw\u002Fpml-2-plugin\u002Foperators","zh_tw\u002Fpml-2-plugin\u002F03.operators",{"title":22,"path":23,"stem":24},"內建函式","\u002Fzh_tw\u002Fpml-2-plugin\u002Ffunctions","zh_tw\u002Fpml-2-plugin\u002F04.functions",false,{"title":27,"path":28,"stem":29,"children":30,"page":25},"PML 2","\u002Fzh_tw\u002Fpml-2","zh_tw\u002Fpml-2",[31,35,39,43,47,51,55,59,63,67,71],{"title":32,"path":33,"stem":34},"介紹 & 下載","\u002Fzh_tw\u002Fpml-2\u002Fintro","zh_tw\u002Fpml-2\u002F01.intro",{"title":36,"path":37,"stem":38},"安裝","\u002Fzh_tw\u002Fpml-2\u002Finstall","zh_tw\u002Fpml-2\u002F02.install",{"title":40,"path":41,"stem":42},"使用者指南","\u002Fzh_tw\u002Fpml-2\u002Fuser_guide","zh_tw\u002Fpml-2\u002F03.user_guide",{"title":44,"path":45,"stem":46},"故障排查","\u002Fzh_tw\u002Fpml-2\u002Ftroubleshooting","zh_tw\u002Fpml-2\u002F04.troubleshooting",{"title":48,"path":49,"stem":50},"設定檔","\u002Fzh_tw\u002Fpml-2\u002Fconfig","zh_tw\u002Fpml-2\u002F05.config",{"title":52,"path":53,"stem":54},"主題","\u002Fzh_tw\u002Fpml-2\u002Fthemes","zh_tw\u002Fpml-2\u002F06.themes",{"title":56,"path":57,"stem":58},"Plugin","\u002Fzh_tw\u002Fpml-2\u002Fplugin","zh_tw\u002Fpml-2\u002F07.plugin",{"title":60,"path":61,"stem":62},"PML 2 隱私權政策","\u002Fzh_tw\u002Fpml-2\u002Fpolicy","zh_tw\u002Fpml-2\u002F08.policy",{"title":64,"path":65,"stem":66},"PML 2 使用者條款","\u002Fzh_tw\u002Fpml-2\u002Fuser_agreement","zh_tw\u002Fpml-2\u002F09.user_agreement",{"title":68,"path":69,"stem":70},"DNS 供應商","\u002Fzh_tw\u002Fpml-2\u002Fdns_providers","zh_tw\u002Fpml-2\u002F10.dns_providers",{"title":72,"path":73,"stem":74},"遙測","\u002Fzh_tw\u002Fpml-2\u002Ftelemetry","zh_tw\u002Fpml-2\u002F11.telemetry",{"id":76,"title":18,"body":77,"description":799,"extension":800,"links":801,"meta":802,"navigation":803,"path":19,"seo":804,"stem":20,"__hash__":805},"docs_zh_tw\u002Fzh_tw\u002Fpml-2-plugin\u002F03.operators.md",{"type":78,"value":79,"toc":791},"minimark",[80,84,89,92,461,494,505,509,512,654,664,668,671],[81,82,83],"p",{},"PML 2 外掛支援值比較運算子與邏輯運算子, 部分運算子有兩種形式。",[85,86,88],"h3",{"id":87},"_1-值比較運算子","1. 值比較運算子",[81,90,91],{},"PML 2 目前支援下列值比較運算子:",[93,94,95,114],"table",{},[96,97,98],"thead",{},[99,100,101,105,108,111],"tr",{},[102,103,104],"th",{},"運算子",[102,106,107],{},"另寫",[102,109,110],{},"說明",[102,112,113],{},"範例",[115,116,117,155,186,211,236,261,286,317,340,372,393,410,427,444],"tbody",{},[99,118,119,126,131,144],{},[120,121,122],"td",{},[123,124,125],"code",{},"-eq",[120,127,128],{},[123,129,130],{},"==",[120,132,133,134,143],{},"判斷運算子左右兩邊的值是否相等。使用 ",[135,136,140],"a",{"href":137,"rel":138},"https:\u002F\u002Flearn.microsoft.com\u002Fzh-tw\u002Fdotnet\u002Fapi\u002Fsystem.object.equals?view=net-10.0",[139],"nofollow",[123,141,142],{},"object.Equals"," 進行比較。",[120,145,146,149,152],{},[123,147,148],{},"{{ctx.data.version}} == \"26.2.0\"",[150,151],"br",{},[123,153,154],{},"{{ctx.data.version}} -eq \"26.2.0\"",[99,156,157,162,167,176],{},[120,158,159],{},[123,160,161],{},"-ne",[120,163,164],{},[123,165,166],{},"!=",[120,168,169,170,175],{},"判斷運算子左右兩邊的值是否不相等。使用 ",[135,171,173],{"href":137,"rel":172},[139],[123,174,142],{}," 的否定結果。",[120,177,178,181,183],{},[123,179,180],{},"{{ctx.data.version}} != \"26.2.0\"",[150,182],{},[123,184,185],{},"{{ctx.data.version}} -ne \"26.2.0\"",[99,187,188,193,198,201],{},[120,189,190],{},[123,191,192],{},"-gt",[120,194,195],{},[123,196,197],{},">",[120,199,200],{},"判斷運算子左邊的值是否大於右邊的值。",[120,202,203,206,208],{},[123,204,205],{},"{{ctx.variables.count}} > 5",[150,207],{},[123,209,210],{},"{{ctx.variables.count}} -gt 5",[99,212,213,218,223,226],{},[120,214,215],{},[123,216,217],{},"-lt",[120,219,220],{},[123,221,222],{},"\u003C",[120,224,225],{},"判斷運算子左邊的值是否小於右邊的值。",[120,227,228,231,233],{},[123,229,230],{},"{{ctx.variables.count}} \u003C 5",[150,232],{},[123,234,235],{},"{{ctx.variables.count}} -lt 5",[99,237,238,243,248,251],{},[120,239,240],{},[123,241,242],{},"-ge",[120,244,245],{},[123,246,247],{},">=",[120,249,250],{},"判斷運算子左邊的值是否大於等於右邊的值。",[120,252,253,256,258],{},[123,254,255],{},"{{ctx.variables.count}} >= 5",[150,257],{},[123,259,260],{},"{{ctx.variables.count}} -ge 5",[99,262,263,268,273,276],{},[120,264,265],{},[123,266,267],{},"-le",[120,269,270],{},[123,271,272],{},"\u003C=",[120,274,275],{},"判斷運算子左邊的值是否小於等於右邊的值。",[120,277,278,281,283],{},[123,279,280],{},"{{ctx.variables.count}} \u003C= 5",[150,282],{},[123,284,285],{},"{{ctx.variables.count}} -le 5",[99,287,288,293,296,312],{},[120,289,290],{},[123,291,292],{},"-like",[120,294,295],{},"無",[120,297,298,299,303,304,307,308,311],{},"判斷運算子左邊的值是否符合運算子右邊的",[300,301,302],"strong",{},"萬用字元","運算式。",[123,305,306],{},"*"," 符合任意長度的字元序列 (包含空序列) ，",[123,309,310],{},"?"," 符合單一字元，其餘字元依字面量處理；整串比對，大小寫不敏感。",[120,313,314],{},[123,315,316],{},"{{ctx.data.os}} -like \"Windows *\"",[99,318,319,324,326,335],{},[120,320,321],{},[123,322,323],{},"-notlike",[120,325,295],{},[120,327,328,329,331,332,334],{},"判斷運算子左邊的值是否不符合運算子右邊的",[300,330,302],{},"運算式，即 ",[123,333,292],{}," 的取反。",[120,336,337],{},[123,338,339],{},"{{ctx.data.os}} -notlike \"Windows *\"",[99,341,342,347,349,367],{},[120,343,344],{},[123,345,346],{},"-match",[120,348,295],{},[120,350,298,351,354,355,358,359,362,363,366],{},[300,352,353],{},"規則表達式"," (.NET 語法) 。為子字串比對，無需在首尾書寫 ",[123,356,357],{},"^"," \u002F ",[123,360,361],{},"$","；大小寫不敏感。規則表達式不合法時傳回 ",[123,364,365],{},"false","。",[120,368,369],{},[123,370,371],{},"{{ctx.data.os}} -match \"Windows \\d+\"",[99,373,374,379,381,388],{},[120,375,376],{},[123,377,378],{},"-notmatch",[120,380,295],{},[120,382,328,383,385,386,334],{},[300,384,353],{},"，即 ",[123,387,346],{},[120,389,390],{},[123,391,392],{},"{{ctx.data.os}} -notmatch \"Windows \\d+\"",[99,394,395,400,402,405],{},[120,396,397],{},[123,398,399],{},"-contains",[120,401,295],{},[120,403,404],{},"若運算子左右兩邊皆為字串, 則判斷運算子左邊的值是否包含右邊的值; 若運算子左邊為集合, 則判斷運算子左邊的集合是否包含運算子右邊的值。(x ∋ y 或 x ⊇ y)",[120,406,407],{},[123,408,409],{},"{{ctx.data.os}} -contains \"Windows\"",[99,411,412,417,419,422],{},[120,413,414],{},[123,415,416],{},"-notcontains",[120,418,295],{},[120,420,421],{},"若運算子左右兩邊皆為字串, 則判斷運算子左邊的值是否不包含右邊的值; 若運算子左邊為集合, 則判斷運算子左邊的集合是否不包含運算子右邊的值。(x ∌ y 或 x ⊅ y)",[120,423,424],{},[123,425,426],{},"{{ctx.data.os}} -notcontains \"Windows\"",[99,428,429,434,436,439],{},[120,430,431],{},[123,432,433],{},"-in",[120,435,295],{},[120,437,438],{},"若運算子左右兩邊皆為字串, 則判斷運算子左邊的值是否包含於右邊的值; 若運算子右邊為集合, 則判斷運算子左邊的值是否包含於運算子右邊的集合。(x ∈ y 或 x ⊆ y)",[120,440,441],{},[123,442,443],{},"\"Windows\" -in {{ctx.data.os}}",[99,445,446,451,453,456],{},[120,447,448],{},[123,449,450],{},"-notin",[120,452,295],{},[120,454,455],{},"若運算子左右兩邊皆為字串, 則判斷運算子左邊的值是否不包含於右邊的值; 若運算子右邊為集合, 則判斷運算子左邊的值是否不包含於運算子右邊的集合。(x ∉ y 或 x ⊄ y)",[120,457,458],{},[123,459,460],{},"\"Windows\" -notin {{ctx.data.os}}",[462,463,464,358,466,468,469,471,472,358,474,468,476,478,479,482,483,485,486,489,490,493],"tip",{},[123,465,292],{},[123,467,323],{}," 使用",[300,470,302],{},"語意，",[123,473,346],{},[123,475,378],{},[300,477,353],{},"語意，兩者不能混用。\n例如要匹配「",[123,480,481],{},"Windows"," 後跟若干數字」應寫作 ",[123,484,371],{},"；\n寫成 ",[123,487,488],{},"-like \"Windows \\d+\""," 時 ",[123,491,492],{},"\\d"," 會被當作字面量字元。",[81,495,496,497,499,500,366],{},"若出現不支援的運算子, 該條件比較一律傳回 ",[123,498,365],{},"。\n部分運算子參考了 PowerShell 指令碼的語法, 您可以在此處查看 ",[135,501,504],{"href":502,"rel":503},"https:\u002F\u002Flearn.microsoft.com\u002Fzh-tw\u002Fpowershell\u002Fmodule\u002Fmicrosoft.powershell.core\u002Fabout\u002Fabout_operators?view=powershell-7.6",[139],"PowerShell 的運算子",[85,506,508],{"id":507},"_2-邏輯運算子","2. 邏輯運算子",[81,510,511],{},"PML 2 目前支援下列邏輯運算子:",[93,513,514,526],{},[96,515,516],{},[99,517,518,520,522,524],{},[102,519,104],{},[102,521,107],{},[102,523,110],{},[102,525,113],{},[115,527,528,578,620],{},[99,529,530,535,540,573],{},[120,531,532],{},[123,533,534],{},"-and",[120,536,537],{},[123,538,539],{},"&&",[120,541,542,543,546,547,550,551,554,555,558,559,561,562,564,565,567,568,570,571,366],{},"計算運算子左右兩邊表達式的邏輯 AND。若 ",[123,544,545],{},"x"," 與 ",[123,548,549],{},"y"," 的計算結果皆為 ",[123,552,553],{},"true",", 則 ",[123,556,557],{},"x && y"," 的結果為 ",[123,560,553],{},"; 否則結果為 ",[123,563,365],{},"。若 ",[123,566,545],{}," 的計算結果為 ",[123,569,365],{},", 則不會計算 ",[123,572,549],{},[120,574,575],{},[123,576,577],{},"{{ctx.data.version}} -eq \"26.2.0\" && {{ctx.data.os}} -contains \"Windows\"",[99,579,580,585,590,615],{},[120,581,582],{},[123,583,584],{},"-or",[120,586,587],{},[123,588,589],{},"||",[120,591,592,593,595,596,598,599,554,601,558,604,606,607,564,609,567,611,570,613,366],{},"計算運算子左右兩邊表達式的邏輯 OR。若 ",[123,594,545],{}," 或 ",[123,597,549],{}," 其中一個計算結果為 ",[123,600,553],{},[123,602,603],{},"x || y",[123,605,553],{},"。否則結果為 ",[123,608,365],{},[123,610,545],{},[123,612,553],{},[123,614,549],{},[120,616,617],{},[123,618,619],{},"{{ctx.data.version}} -eq \"26.2.0\" || {{ctx.data.os}} -notcontains \"Windows\"",[99,621,622,627,634,649],{},[120,623,624],{},[123,625,626],{},"-xor",[120,628,629,595,632],{},[123,630,631],{},"^|",[123,633,357],{},[120,635,636,637,546,639,641,642,558,645,606,647,366],{},"計算運算子左右兩邊表達式的邏輯 XOR。若 ",[123,638,545],{},[123,640,549],{}," 的計算結果不同, 則 ",[123,643,644],{},"x ^| y",[123,646,553],{},[123,648,365],{},[120,650,651],{},[123,652,653],{},"{{ctx.data.version}} -eq \"26.2.0\" ^| {{ctx.data.os}} -contains \"Windows\"",[655,656,657,658,663],"note",{},"前往 ",[135,659,662],{"href":660,"rel":661},"https:\u002F\u002Flearn.microsoft.com\u002Fzh-tw\u002Fdotnet\u002Fcsharp\u002Flanguage-reference\u002Foperators\u002Fboolean-logical-operators",[139],"MSDN"," 以了解更多有關邏輯運算子的內容。",[85,665,667],{"id":666},"_3-算術運算子","3. 算術運算子",[81,669,670],{},"PML 2 目前支援下列算術運算子:",[93,672,673,683],{},[96,674,675],{},[99,676,677,679,681],{},[102,678,104],{},[102,680,110],{},[102,682,113],{},[115,684,685,700,715,729,744,759,774],{},[99,686,687,692,695],{},[120,688,689],{},[123,690,691],{},"+",[120,693,694],{},"加法運算子, 用於計算運算子左右兩邊的值的和。",[120,696,697],{},[123,698,699],{},"{{ctx.variables.count}} + 5",[99,701,702,707,710],{},[120,703,704],{},[123,705,706],{},"-",[120,708,709],{},"減法運算子, 用於計算運算子左右兩邊的值的差。",[120,711,712],{},[123,713,714],{},"{{ctx.variables.count}} - 5",[99,716,717,721,724],{},[120,718,719],{},[123,720,306],{},[120,722,723],{},"乘法運算子, 用於計算運算子左右兩邊的值的積。",[120,725,726],{},[123,727,728],{},"{{ctx.variables.count}} * 5",[99,730,731,736,739],{},[120,732,733],{},[123,734,735],{},"\u002F",[120,737,738],{},"除法運算子, 用於計算運算子左右兩邊的值的商。",[120,740,741],{},[123,742,743],{},"{{ctx.variables.count}} \u002F 5",[99,745,746,751,754],{},[120,747,748],{},[123,749,750],{},"%",[120,752,753],{},"取模運算子, 用於計算運算子左右兩邊的值的餘數。",[120,755,756],{},[123,757,758],{},"{{ctx.variables.count}} % 5",[99,760,761,766,769],{},[120,762,763],{},[123,764,765],{},"\u002F\u002F",[120,767,768],{},"整數除法運算子, 用於計算運算子左右兩邊的值的商的整數部分。",[120,770,771],{},[123,772,773],{},"{{ctx.variables.count}} \u002F\u002F 5",[99,775,776,783,786],{},[120,777,778,595,781],{},[123,779,780],{},"**",[123,782,357],{},[120,784,785],{},"冪運算子, 用於計算運算子左邊的值的右邊的値次方。",[120,787,788],{},[123,789,790],{},"{{ctx.variables.count}} ** 5",{"title":792,"searchDepth":793,"depth":793,"links":794},"",2,[795,797,798],{"id":87,"depth":796,"text":88},3,{"id":507,"depth":796,"text":508},{"id":666,"depth":796,"text":667},"本文件介紹 PML 2 外掛系統的運算子。","md",null,{},true,{"title":18,"description":799},"IETeJXE84-t2bETDQSs_W3OuwDEaP6g5CPpKltOFAug",[807,809],{"title":14,"path":15,"stem":16,"description":808,"children":-1},"本文件介紹 PML 2 外掛系統的所有觸發點。",{"title":22,"path":23,"stem":24,"description":810,"children":-1},"本文將介紹 PML 2 外掛系統中條件與動作樣板可用的內建函式與算術運算子。",1791004266536]