powershell - PowerShell 中的 bool 文字

标签 powershell

PowerShell 中的 bool 文字是什么?

最佳答案

$true$false

不过,这些都是常数。 bool 值没有语言级文字。

根据您需要它们的位置,如果类型必须是 bool 值,您还可以使用任何强制为 bool 值的内容,例如,在需要 bool 值的方法调用中(并且没有冲突)过载)或条件语句。例如,大多数非空对象都是 true。 null、空字符串、空数组和数字0 均为 false。

关于powershell - PowerShell 中的 bool 文字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10581206/

相关文章:

powershell - 使用 powershell 对象执行脚本

powershell - 为什么用单个字符而不是单个字符串填充PSCustomObject?

powershell - 指定某些高级性能级别时,Azure PowerShell Get-AzureSqlDatabaseServiceObjective 返回 null

powershell - 如何一次获取所有管道元素?

powershell - 使用计时器同时崩溃多个Powershell脚本

powershell - 有没有办法使用 Powershell 操作内存中的 zip 文件内容?

Powershell 安全密码可在任何机器上工作

azure - 在Powershell中获取azure资源的标签值

windows - 如何在不手动登录从机的情况下以编程方式启动 Jenkins slave

powershell - 错误变量输出