1
1
---
2
- external help file : Microsoft.PowerShell.Commands.Utility.dll-Help .xml
2
+ external help file : Microsoft.PowerShell.Commands.Utility.dll-help .xml
3
3
keywords : powershell,cmdlet
4
4
locale : en-us
5
+ Module Name : Microsoft.PowerShell.Utility
5
6
ms.date : 4/26/2019
6
7
online version : https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/add-member?view=powershell-3.0&WT.mc_id=ps-gethelp
7
8
schema : 2.0.0
@@ -10,39 +11,35 @@ title: Add-Member
10
11
# Add-Member
11
12
12
13
## SYNOPSIS
13
- Adds custom properties and methods to an instance of a Windows PowerShell object.
14
+ Adds custom properties and methods to an instance of a PowerShell object.
14
15
15
16
## SYNTAX
16
17
17
18
### TypeNameSet (Default)
18
19
19
20
```
20
- Add-Member -InputObject <PSObject> -TypeName <String> [-PassThru]
21
- [<CommonParameters>]
21
+ Add-Member -InputObject <PSObject> -TypeName <String> [-PassThru] [<CommonParameters>]
22
22
```
23
23
24
- ### MemberSet
24
+ ### NotePropertyMultiMemberSet
25
25
26
26
```
27
- Add-Member [-MemberType] <PSMemberTypes> [-Name] <String>
28
- [[-Value] <Object>] [[-SecondValue] <Object>]
29
- -InputObject <PSObject> [-TypeName <String>] [-Force] [-PassThru]
30
- [<CommonParameters>]
27
+ Add-Member [-NotePropertyMembers] <IDictionary> -InputObject <PSObject> [-TypeName <String>]
28
+ [-Force] [-PassThru] [<CommonParameters>]
31
29
```
32
30
33
31
### NotePropertySingleMemberSet
34
32
35
33
```
36
- Add-Member [-NotePropertyName] <String> [-NotePropertyValue] <Object>
37
- -InputObject <PSObject> [-TypeName <String>] [-Force] [-PassThru]
38
- [<CommonParameters>]
34
+ Add-Member [-NotePropertyName] <String> [-NotePropertyValue] <Object> -InputObject <PSObject>
35
+ [-TypeName <String>] [-Force] [-PassThru] [<CommonParameters>]
39
36
```
40
37
41
- ### NotePropertyMultiMemberSet
38
+ ### MemberSet
42
39
43
40
```
44
- Add-Member [-NotePropertyMembers ] <IDictionary>
45
- -InputObject <PSObject> [-TypeName <String>] [-Force] [-PassThru]
41
+ Add-Member [-MemberType ] <PSMemberTypes> [-Name] <String> [[-Value] <Object>]
42
+ [[-SecondValue] <Object>] -InputObject <PSObject> [-TypeName <String>] [-Force] [-PassThru]
46
43
[<CommonParameters>]
47
44
```
48
45
@@ -125,7 +122,7 @@ $A.Size
125
122
### Example 3: Add a StringUse note property to a string
126
123
127
124
This example adds the ** StringUse** note property to a string.
128
- Because ` Add-Member ` cannot add types to ** String** input objects, you can speciy the ** PassThru**
125
+ Because ` Add-Member ` cannot add types to ** String** input objects, you can specify the ** PassThru**
129
126
parameter to generate an output object. The last command in the example displays the new property.
130
127
131
128
This example uses the ** NotePropertyMembers** parameter. The value of the ** NotePropertyMembers**
@@ -273,7 +270,7 @@ The acceptable values for this parameter are:
273
270
- ScriptProperty
274
271
- CodeProperty
275
272
- ScriptMethod
276
- - CopyMethod
273
+ - CodeMethod
277
274
278
275
For information about these values, see [PSMemberTypes Enumeration](/dotnet/api/system.management.automation.psmembertypes)
279
276
in the MSDN library.
@@ -291,7 +288,7 @@ Required: True
291
288
Position : 0
292
289
Default value : None
293
290
Accept pipeline input : False
294
- Accept wildcard characters : True
291
+ Accept wildcard characters : False
295
292
` ` `
296
293
297
294
### -Name
@@ -310,6 +307,71 @@ Accept pipeline input: False
310
307
Accept wildcard characters : False
311
308
` ` `
312
309
310
+ ### -NotePropertyMembers
311
+
312
+ Specifies a hash table or ordered dictionary of note property names and values.
313
+ Type a hash table or dictionary in which the keys are note property names and the values are note
314
+ property values.
315
+
316
+ For more information about hash tables and ordered dictionaries in PowerShell, see
317
+ [about_Hash_Tables](../Microsoft.PowerShell.Core/About/about_Hash_Tables.md).
318
+
319
+ This parameter was introduced in Windows PowerShell 3.0.
320
+
321
+ ` ` ` yaml
322
+ Type : IDictionary
323
+ Parameter Sets : NotePropertyMultiMemberSet
324
+ Aliases :
325
+
326
+ Required : True
327
+ Position : 0
328
+ Default value : None
329
+ Accept pipeline input : False
330
+ Accept wildcard characters : False
331
+ ` ` `
332
+
333
+ ### -NotePropertyName
334
+
335
+ Specifies the note property name.
336
+
337
+ Use this parameter with the **NotePropertyValue** parameter.
338
+ This parameter is optional.
339
+
340
+ This parameter was introduced in Windows PowerShell 3.0.
341
+
342
+ ` ` ` yaml
343
+ Type : String
344
+ Parameter Sets : NotePropertySingleMemberSet
345
+ Aliases :
346
+
347
+ Required : True
348
+ Position : 0
349
+ Default value : None
350
+ Accept pipeline input : False
351
+ Accept wildcard characters : False
352
+ ` ` `
353
+
354
+ ### -NotePropertyValue
355
+
356
+ Specifies the note property value.
357
+
358
+ Use this parameter with the **NotePropertyName** parameter.
359
+ This parameter is optional.
360
+
361
+ This parameter was introduced in Windows PowerShell 3.0.
362
+
363
+ ` ` ` yaml
364
+ Type : Object
365
+ Parameter Sets : NotePropertySingleMemberSet
366
+ Aliases :
367
+
368
+ Required : True
369
+ Position : 1
370
+ Default value : None
371
+ Accept pipeline input : False
372
+ Accept wildcard characters : False
373
+ ` ` `
374
+
313
375
### -PassThru
314
376
315
377
Returns an object representing the item with which you are working.
@@ -331,7 +393,7 @@ Aliases:
331
393
332
394
Required: False
333
395
Position: Named
334
- Default value: False
396
+ Default value: None
335
397
Accept pipeline input: False
336
398
Accept wildcard characters: False
337
399
` ` `
@@ -384,71 +446,6 @@ Accept pipeline input: False
384
446
Accept wildcard characters: False
385
447
` ` `
386
448
387
- # ## -NotePropertyMembers
388
-
389
- Specifies a hash table or ordered dictionary of note property names and values.
390
- Type a hash table or dictionary in which the keys are note property names and the values are note
391
- property values.
392
-
393
- For more information about hash tables and ordered dictionaries in PowerShell, see
394
- [about_Hash_Tables](../Microsoft.PowerShell.Core/About/about_Hash_Tables.md).
395
-
396
- This parameter was introduced in Windows PowerShell 3.0.
397
-
398
- ` ` ` yaml
399
- Type: IDictionary
400
- Parameter Sets: NotePropertyMultiMemberSet
401
- Aliases:
402
-
403
- Required: True
404
- Position: 0
405
- Default value: None
406
- Accept pipeline input: False
407
- Accept wildcard characters: False
408
- ` ` `
409
-
410
- # ## -NotePropertyName
411
-
412
- Specifies the note property name.
413
-
414
- Use this parameter with the **NotePropertyValue** parameter.
415
- This parameter is optional.
416
-
417
- This parameter was introduced in Windows PowerShell 3.0.
418
-
419
- ` ` ` yaml
420
- Type: String
421
- Parameter Sets: NotePropertySingleMemberSet
422
- Aliases:
423
-
424
- Required: True
425
- Position: 0
426
- Default value: None
427
- Accept pipeline input: False
428
- Accept wildcard characters: False
429
- ` ` `
430
-
431
- # ## -NotePropertyValue
432
-
433
- Specifies the note property value.
434
-
435
- Use this parameter with the **NotePropertyName** parameter.
436
- This parameter is optional.
437
-
438
- This parameter was introduced in Windows PowerShell 3.0.
439
-
440
- ` ` ` yaml
441
- Type: Object
442
- Parameter Sets: NotePropertySingleMemberSet
443
- Aliases:
444
-
445
- Required: True
446
- Position: 1
447
- Default value: None
448
- Accept pipeline input: False
449
- Accept wildcard characters: False
450
- ` ` `
451
-
452
449
# ## -TypeName
453
450
454
451
Specifies a name for the type.
0 commit comments