首页 > 解决方案 > Powershell:-或在while循环中

问题描述

我的格式有什么问题。当只有一个条件时,代码运行。当我添加 -or 和第二个条件来检查时,它似乎也没有检查。

    while(($TempLog.id -ne "18") -or ($TempLog.id -ne "32"))
    {
        $TempLog = Get-WinEvent -computername F9P8NW2-5300 -LogName 'Microsoft-Windows-RemoteAssistance/Operational'-MaxEvents 1
    }

在此处输入代码

标签: powershelloperators

解决方案


推荐阅读