オブジェクトの配列があり、それを操作しようとすると、プロパティ RptFile が存在しないというエラーが発生します。スペルとすべてをチェックしましたが、何が起こっているのか困惑しています。
エラーを与えるコード:
$AllContents | Where-Object {$_.RptFile -eq 'CB-Officer Trial New'}
AllContents | Get-Member returns:
TypeName: Selected.System.Management.Automation.PSCustomObject
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
RptFile NoteProperty System.String RptFile=ABL - Branch5206 Daily OD Report
TotalSeconds NoteProperty System.String TotalSeconds=25
したがって、プロパティは存在します。何が起こっているのですか?$AllContents と入力すると、プロパティのリストも表示されます。