質問編集履歴

1

質問が分かりづらいので追記

2019/02/23 14:36

投稿

sugarrabbit
sugarrabbit

スコア16

test CHANGED
File without changes
test CHANGED
@@ -67,3 +67,63 @@
67
67
 
68
68
 
69
69
  Powershell Ver 5.0 です
70
+
71
+
72
+
73
+
74
+
75
+ ### 追記
76
+
77
+ 最終目的の例としては例えば以下のように配列などでオブジェクトを構成した場合
78
+
79
+ ```powershell
80
+
81
+ $ChildOBJ1 = New-Object PSCustomObject
82
+
83
+ $ChildOBJ1 | Add-Member -NotePropertyName "Name" -NotePropertyValue "佐藤"
84
+
85
+ $ChildOBJ1 | Add-Member -NotePropertyName "Location" -NotePropertyValue "TOKYO"
86
+
87
+
88
+
89
+ $ChildOBJ2 = New-Object PSCustomObject
90
+
91
+ $ChildOBJ2 | Add-Member -NotePropertyName "Name" -NotePropertyValue "鈴木"
92
+
93
+ $ChildOBJ2 | Add-Member -NotePropertyName "Location" -NotePropertyValue "OSAKA"
94
+
95
+
96
+
97
+ $Array = New-Object System.Collections.Arraylist
98
+
99
+ $Array.add($ChildOBJ1)
100
+
101
+ $Array.add($ChildOBJ2)
102
+
103
+
104
+
105
+ $CustomOBJ = New-Object PSCustomObject
106
+
107
+ $CustomOBJ | Add-Member -NotePropertyName "Person" -NotePropertyValue $Array
108
+
109
+ $CustomOBJ | Add-Member -NotePropertyName "Group" -NotePropertyValue "本社"
110
+
111
+
112
+
113
+ ```
114
+
115
+
116
+
117
+ 以下のように表示されてほしいです
118
+
119
+ ```powershell
120
+
121
+ $CustomOBJ | FL
122
+
123
+
124
+
125
+ Person : {佐藤, 鈴木}
126
+
127
+ Group : 本社
128
+
129
+ ```