1
我想添加一個屬性使用添加成員。這裏是我的代碼:添加成員:如何傳遞scriptblock?
$f = ""
$f = $f | select started, ended
$f | add-member scriptProperty IsFinished { $this.Started -gte $this.Ended }
然而,在最後一行代碼拋出一個異常,我相信,因爲我的腳本塊表達「-gte」。例外說: 您必須在' - '運算符的右側提供一個值表達式。