gpt4 book ai didi

powershell - 类似 PowerShell 的运算符支持哪些模式?

转载 作者:行者123 更新时间:2023-12-04 03:00:46 24 4
gpt4 key购买 nike

我找不到任何有关 PowerShell 语法的引用 -like运营商。

comparison operators 上的 Windows PowerShell 引用仅声明:

-Like
Description: Match using the wildcard character (*).



虽然通过实验我发现它也支持 ?[] (设置)。

是否支持任何其他语法?是否有明确的引用 -like运营商?

最佳答案

about_Comparison_Operators的帮助确实声称支持通配符。它没有具体说明通配符是什么。

-Like Description: Match using the wildcard character (*).



进一步深入了解帮助 about_Wildcards我们了解到这些不是你爷爷的通配符:

Windows PowerShell supports the following wildcard characters.

Wildcard Description Example Match No match
-------- ------------------ -------- ----------------- --------
* Matches zero or a* A, ag, Apple banana
more characters

? Matches exactly ?n an, in, on ran
one character in
the specified
position

[ ] Matches a range [a-l]ook book, cook, look took
of characters

[ ] Matches specified [bc]ook book, cook hook
characters


about_Comparision_Operators 帮助中的另见部分中提到了通配符帮助的链接。

关于powershell - 类似 PowerShell 的运算符支持哪些模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26778044/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com