我需要您的幫助,使用Powershell中的變量。Powershell - 從變量中使用Get-StorageGroupCopyStatus
我想將Get-StorageGroupCopyStatus的結果放入一個變量中,然後能夠使用結果中的參數。
當我執行
Get-StorageGroupCopyStatus -Server server -StandbyMachine standbyserver
返回幾個屬性,如「名稱」,「SummaryCopyStatus爲‘CopyQueueLength’,等等。 的事情是,我希望能夠通過操縱這些屬性爲了變量能夠使用它在一個IF語句,就像這樣:
$st = Get-StorageGroupCopyStatus -Server server -StandbyMachine standbyserver
if ($st.SummaryCopyStatus -NotMatch "Healthy")
發生了什麼事是,參數「.SummaryCopyStatus」無法通過變量‘$ ST’獲得
我在這裏錯過了什麼?