0
我在一個非常奇怪的powershell行爲。 我有一個If,elseif,else。 如果作品,其他如果作品,但從未發生過。疑難解答,如果在PowerShell中
它可能是什麼?
這是腳本:
$result = Get-AMTHardwareAsset $Computer -credential $VProCredential -textoutput
if ($result.Contains("Unauthorized") -eq $true)
{
Add-Results "$Computer`tHardwareAssets-Unauthorized"
}
elseif ($result.Contains("Could not connect") -eq $true)
{
Add-Results "$Computer`tHardwareAssets-CannotConect"
}
else
{
Add-Results "TESTING"
}
哇。我不知道它會是什麼。我也看着我。我也測試了$結果的哈希編碼。我如何解決這些問題? – 2012-08-14 07:51:58
@RicardoPolo使用ISE的調試器。尤其是'$ result'的值。 – Richard 2012-08-14 08:03:43