Freigeben über


PSPrimitiveDictionary.Add Method

Definition

Overloads

Add(String, SByte[])

Adds an element with the specified key and value into the Hashtable.

Add(String, Single)

Adds an element with the specified key and value into the Hashtable.

Add(String, Single[])

Adds an element with the specified key and value into the Hashtable.

Add(String, String)

Adds an element with the specified key and value into the Hashtable.

Add(String, String[])

Adds an element with the specified key and value into the Hashtable.

Add(String, TimeSpan)

Adds an element with the specified key and value into the Hashtable.

Add(String, TimeSpan[])

Adds an element with the specified key and value into the Hashtable.

Add(String, UInt16)

Adds an element with the specified key and value into the Hashtable.

Add(String, UInt16[])

Adds an element with the specified key and value into the Hashtable.

Add(String, UInt32)

Adds an element with the specified key and value into the Hashtable.

Add(String, UInt32[])

Adds an element with the specified key and value into the Hashtable.

Add(String, UInt64)

Adds an element with the specified key and value into the Hashtable.

Add(String, UInt64[])

Adds an element with the specified key and value into the Hashtable.

Add(String, Uri)

Adds an element with the specified key and value into the Hashtable.

Add(String, Uri[])

Adds an element with the specified key and value into the Hashtable.

Add(String, Version)

Adds an element with the specified key and value into the Hashtable.

Add(String, Version[])

Adds an element with the specified key and value into the Hashtable.

Add(String, SByte)

Adds an element with the specified key and value into the Hashtable.

Add(String, PSPrimitiveDictionary[])

Adds an element with the specified key and value into the Hashtable.

Add(String, PSPrimitiveDictionary)

Adds an element with the specified key and value into the Hashtable.

Add(String, Int64[])

Adds an element with the specified key and value into the Hashtable.

Add(Object, Object)

Adds an element with the specified key and value into the Hashtable.

Add(String, Boolean)

Adds an element with the specified key and value into the Hashtable.

Add(String, Boolean[])

Adds an element with the specified key and value into the Hashtable.

Add(String, Byte)

Adds an element with the specified key and value into the Hashtable.

Add(String, Byte[])

Adds an element with the specified key and value into the Hashtable.

Add(String, Char)

Adds an element with the specified key and value into the Hashtable.

Add(String, Char[])

Adds an element with the specified key and value into the Hashtable.

Add(String, DateTime)

Adds an element with the specified key and value into the Hashtable.

Add(String, DateTime[])

Adds an element with the specified key and value into the Hashtable.

Add(String, Decimal[])

Adds an element with the specified key and value into the Hashtable.

Add(String, Double)

Adds an element with the specified key and value into the Hashtable.

Add(String, Double[])

Adds an element with the specified key and value into the Hashtable.

Add(String, Guid)

Adds an element with the specified key and value into the Hashtable.

Add(String, Guid[])

Adds an element with the specified key and value into the Hashtable.

Add(String, Int32)

Adds an element with the specified key and value into the Hashtable.

Add(String, Int32[])

Adds an element with the specified key and value into the Hashtable.

Add(String, Int64)

Adds an element with the specified key and value into the Hashtable.

Add(String, Decimal)

Adds an element with the specified key and value into the Hashtable.

Add(String, SByte[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <System::SByte> ^ value);
public:
 void Add(Platform::String ^ key, Platform::Array <SByte> ^ value);
void Add(std::wstring const & key, std::Array <SByte> const & value);
public void Add (string key, sbyte[] value);
override this.Add : string * sbyte[] -> unit
Public Sub Add (key As String, value As SByte())

Parameters

key
String

The key of the element to add.

value
SByte[]

The value of the element to add.

Applies to

Add(String, Single)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, float value);
public:
 void Add(Platform::String ^ key, float value);
void Add(std::wstring const & key, float value);
public void Add (string key, float value);
override this.Add : string * single -> unit
Public Sub Add (key As String, value As Single)

Parameters

key
String

The key of the element to add.

value
Single

The value of the element to add.

Applies to

Add(String, Single[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <float> ^ value);
public:
 void Add(Platform::String ^ key, Platform::Array <float> ^ value);
void Add(std::wstring const & key, std::Array <float> const & value);
public void Add (string key, float[] value);
override this.Add : string * single[] -> unit
Public Sub Add (key As String, value As Single())

Parameters

key
String

The key of the element to add.

value
Single[]

The value of the element to add.

Applies to

Add(String, String)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, System::String ^ value);
public:
 void Add(Platform::String ^ key, Platform::String ^ value);
void Add(std::wstring const & key, std::wstring const & value);
public void Add (string key, string value);
override this.Add : string * string -> unit
Public Sub Add (key As String, value As String)

Parameters

key
String

The key of the element to add.

value
String

The value of the element to add.

Applies to

Add(String, String[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <System::String ^> ^ value);
public:
 void Add(Platform::String ^ key, Platform::Array <Platform::String ^> ^ value);
void Add(std::wstring const & key, std::Array <std::wstring const &> const & value);
public void Add (string key, string[] value);
override this.Add : string * string[] -> unit
Public Sub Add (key As String, value As String())

Parameters

key
String

The key of the element to add.

value
String[]

The value of the element to add.

Applies to

Add(String, TimeSpan)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, TimeSpan value);
public void Add (string key, TimeSpan value);
override this.Add : string * TimeSpan -> unit
Public Sub Add (key As String, value As TimeSpan)

Parameters

key
String

The key of the element to add.

value
TimeSpan

The value of the element to add.

Applies to

Add(String, TimeSpan[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <TimeSpan> ^ value);
public void Add (string key, TimeSpan[] value);
override this.Add : string * TimeSpan[] -> unit
Public Sub Add (key As String, value As TimeSpan())

Parameters

key
String

The key of the element to add.

value
TimeSpan[]

The value of the element to add.

Applies to

Add(String, UInt16)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, System::UInt16 value);
public:
 void Add(Platform::String ^ key, unsigned short value);
void Add(std::wstring const & key, unsigned short value);
public void Add (string key, ushort value);
override this.Add : string * uint16 -> unit
Public Sub Add (key As String, value As UShort)

Parameters

key
String

The key of the element to add.

value
UInt16

The value of the element to add.

Applies to

Add(String, UInt16[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <System::UInt16> ^ value);
public:
 void Add(Platform::String ^ key, Platform::Array <unsigned short> ^ value);
void Add(std::wstring const & key, std::Array <unsigned short> const & value);
public void Add (string key, ushort[] value);
override this.Add : string * uint16[] -> unit
Public Sub Add (key As String, value As UShort())

Parameters

key
String

The key of the element to add.

value
UInt16[]

The value of the element to add.

Applies to

Add(String, UInt32)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, System::UInt32 value);
public:
 void Add(Platform::String ^ key, unsigned int value);
void Add(std::wstring const & key, unsigned int value);
public void Add (string key, uint value);
override this.Add : string * uint32 -> unit
Public Sub Add (key As String, value As UInteger)

Parameters

key
String

The key of the element to add.

value
UInt32

The value of the element to add.

Applies to

Add(String, UInt32[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <System::UInt32> ^ value);
public:
 void Add(Platform::String ^ key, Platform::Array <unsigned int> ^ value);
void Add(std::wstring const & key, std::Array <unsigned int> const & value);
public void Add (string key, uint[] value);
override this.Add : string * uint32[] -> unit
Public Sub Add (key As String, value As UInteger())

Parameters

key
String

The key of the element to add.

value
UInt32[]

The value of the element to add.

Applies to

Add(String, UInt64)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, System::UInt64 value);
public:
 void Add(Platform::String ^ key, unsigned long long value);
void Add(std::wstring const & key, unsigned long value);
public void Add (string key, ulong value);
override this.Add : string * uint64 -> unit
Public Sub Add (key As String, value As ULong)

Parameters

key
String

The key of the element to add.

value
UInt64

The value of the element to add.

Applies to

Add(String, UInt64[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <System::UInt64> ^ value);
public:
 void Add(Platform::String ^ key, Platform::Array <unsigned long long> ^ value);
void Add(std::wstring const & key, std::Array <unsigned long> const & value);
public void Add (string key, ulong[] value);
override this.Add : string * uint64[] -> unit
Public Sub Add (key As String, value As ULong())

Parameters

key
String

The key of the element to add.

value
UInt64[]

The value of the element to add.

Applies to

Add(String, Uri)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, Uri ^ value);
public void Add (string key, Uri value);
override this.Add : string * Uri -> unit
Public Sub Add (key As String, value As Uri)

Parameters

key
String

The key of the element to add.

value
Uri

The value of the element to add.

Applies to

Add(String, Uri[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <Uri ^> ^ value);
public void Add (string key, Uri[] value);
override this.Add : string * Uri[] -> unit
Public Sub Add (key As String, value As Uri())

Parameters

key
String

The key of the element to add.

value
Uri[]

The value of the element to add.

Applies to

Add(String, Version)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, Version ^ value);
public void Add (string key, Version value);
override this.Add : string * Version -> unit
Public Sub Add (key As String, value As Version)

Parameters

key
String

The key of the element to add.

value
Version

The value of the element to add.

Applies to

Add(String, Version[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <Version ^> ^ value);
public void Add (string key, Version[] value);
override this.Add : string * Version[] -> unit
Public Sub Add (key As String, value As Version())

Parameters

key
String

The key of the element to add.

value
Version[]

The value of the element to add.

Applies to

Add(String, SByte)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, System::SByte value);
public:
 void Add(Platform::String ^ key, SByte value);
void Add(std::wstring const & key, SByte value);
public void Add (string key, sbyte value);
override this.Add : string * sbyte -> unit
Public Sub Add (key As String, value As SByte)

Parameters

key
String

The key of the element to add.

value
SByte

The value of the element to add.

Applies to

Add(String, PSPrimitiveDictionary[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <System::Management::Automation::PSPrimitiveDictionary ^> ^ value);
public void Add (string key, System.Management.Automation.PSPrimitiveDictionary[] value);
override this.Add : string * System.Management.Automation.PSPrimitiveDictionary[] -> unit
Public Sub Add (key As String, value As PSPrimitiveDictionary())

Parameters

key
String

The key of the element to add.

value
PSPrimitiveDictionary[]

The value of the element to add.

Applies to

Add(String, PSPrimitiveDictionary)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, System::Management::Automation::PSPrimitiveDictionary ^ value);
public void Add (string key, System.Management.Automation.PSPrimitiveDictionary value);
override this.Add : string * System.Management.Automation.PSPrimitiveDictionary -> unit
Public Sub Add (key As String, value As PSPrimitiveDictionary)

Parameters

key
String

The key of the element to add.

value
PSPrimitiveDictionary

The value of the element to add.

Applies to

Add(String, Int64[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <long> ^ value);
public:
 void Add(Platform::String ^ key, Platform::Array <long long> ^ value);
void Add(std::wstring const & key, std::Array <long> const & value);
public void Add (string key, long[] value);
override this.Add : string * int64[] -> unit
Public Sub Add (key As String, value As Long())

Parameters

key
String

The key of the element to add.

value
Int64[]

The value of the element to add.

Applies to

Add(Object, Object)

Adds an element with the specified key and value into the Hashtable.

public:
 override void Add(System::Object ^ key, System::Object ^ value);
public:
 override void Add(Platform::Object ^ key, Platform::Object ^ value);
 override void Add(winrt::Windows::Foundation::IInspectable const & key, winrt::Windows::Foundation::IInspectable const & value);
public override void Add (object key, object value);
override this.Add : obj * obj -> unit
Public Overrides Sub Add (key As Object, value As Object)

Parameters

key
Object

The key of the element to add.

value
Object

The value of the element to add.

Exceptions

This method will throw if the key is not a string and the value is not one of primitive types that will work during PowerShell remoting handshake. Use of strongly-typed overloads of this method is suggested if throwing an exception is not acceptable.

Applies to

Add(String, Boolean)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, bool value);
public:
 void Add(Platform::String ^ key, bool value);
void Add(std::wstring const & key, bool value);
public void Add (string key, bool value);
override this.Add : string * bool -> unit
Public Sub Add (key As String, value As Boolean)

Parameters

key
String

The key of the element to add.

value
Boolean

The value of the element to add.

Applies to

Add(String, Boolean[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <bool> ^ value);
public:
 void Add(Platform::String ^ key, Platform::Array <bool> ^ value);
void Add(std::wstring const & key, std::Array <bool> const & value);
public void Add (string key, bool[] value);
override this.Add : string * bool[] -> unit
Public Sub Add (key As String, value As Boolean())

Parameters

key
String

The key of the element to add.

value
Boolean[]

The value of the element to add.

Applies to

Add(String, Byte)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, System::Byte value);
public:
 void Add(Platform::String ^ key, byte value);
void Add(std::wstring const & key, byte value);
public void Add (string key, byte value);
override this.Add : string * byte -> unit
Public Sub Add (key As String, value As Byte)

Parameters

key
String

The key of the element to add.

value
Byte

The value of the element to add.

Applies to

Add(String, Byte[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <System::Byte> ^ value);
public:
 void Add(Platform::String ^ key, Platform::Array <byte> ^ value);
void Add(std::wstring const & key, std::Array <byte> const & value);
public void Add (string key, byte[] value);
override this.Add : string * byte[] -> unit
Public Sub Add (key As String, value As Byte())

Parameters

key
String

The key of the element to add.

value
Byte[]

The value of the element to add.

Applies to

Add(String, Char)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, char value);
public:
 void Add(Platform::String ^ key, char16 value);
void Add(std::wstring const & key, char value);
public void Add (string key, char value);
override this.Add : string * char -> unit
Public Sub Add (key As String, value As Char)

Parameters

key
String

The key of the element to add.

value
Char

The value of the element to add.

Applies to

Add(String, Char[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <char> ^ value);
public:
 void Add(Platform::String ^ key, Platform::Array <char16> ^ value);
void Add(std::wstring const & key, std::Array <char> const & value);
public void Add (string key, char[] value);
override this.Add : string * char[] -> unit
Public Sub Add (key As String, value As Char())

Parameters

key
String

The key of the element to add.

value
Char[]

The value of the element to add.

Applies to

Add(String, DateTime)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, DateTime value);
public void Add (string key, DateTime value);
override this.Add : string * DateTime -> unit
Public Sub Add (key As String, value As DateTime)

Parameters

key
String

The key of the element to add.

value
DateTime

The value of the element to add.

Applies to

Add(String, DateTime[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <DateTime> ^ value);
public void Add (string key, DateTime[] value);
override this.Add : string * DateTime[] -> unit
Public Sub Add (key As String, value As DateTime())

Parameters

key
String

The key of the element to add.

value
DateTime[]

The value of the element to add.

Applies to

Add(String, Decimal[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <System::Decimal> ^ value);
public void Add (string key, decimal[] value);
override this.Add : string * decimal[] -> unit
Public Sub Add (key As String, value As Decimal())

Parameters

key
String

The key of the element to add.

value
Decimal[]

The value of the element to add.

Applies to

Add(String, Double)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, double value);
public:
 void Add(Platform::String ^ key, double value);
void Add(std::wstring const & key, double value);
public void Add (string key, double value);
override this.Add : string * double -> unit
Public Sub Add (key As String, value As Double)

Parameters

key
String

The key of the element to add.

value
Double

The value of the element to add.

Applies to

Add(String, Double[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <double> ^ value);
public:
 void Add(Platform::String ^ key, Platform::Array <double> ^ value);
void Add(std::wstring const & key, std::Array <double> const & value);
public void Add (string key, double[] value);
override this.Add : string * double[] -> unit
Public Sub Add (key As String, value As Double())

Parameters

key
String

The key of the element to add.

value
Double[]

The value of the element to add.

Applies to

Add(String, Guid)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, Guid value);
public void Add (string key, Guid value);
override this.Add : string * Guid -> unit
Public Sub Add (key As String, value As Guid)

Parameters

key
String

The key of the element to add.

value
Guid

The value of the element to add.

Applies to

Add(String, Guid[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <Guid> ^ value);
public void Add (string key, Guid[] value);
override this.Add : string * Guid[] -> unit
Public Sub Add (key As String, value As Guid())

Parameters

key
String

The key of the element to add.

value
Guid[]

The value of the element to add.

Applies to

Add(String, Int32)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, int value);
public:
 void Add(Platform::String ^ key, int value);
void Add(std::wstring const & key, int value);
public void Add (string key, int value);
override this.Add : string * int -> unit
Public Sub Add (key As String, value As Integer)

Parameters

key
String

The key of the element to add.

value
Int32

The value of the element to add.

Applies to

Add(String, Int32[])

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, cli::array <int> ^ value);
public:
 void Add(Platform::String ^ key, Platform::Array <int> ^ value);
void Add(std::wstring const & key, std::Array <int> const & value);
public void Add (string key, int[] value);
override this.Add : string * int[] -> unit
Public Sub Add (key As String, value As Integer())

Parameters

key
String

The key of the element to add.

value
Int32[]

The value of the element to add.

Applies to

Add(String, Int64)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, long value);
public:
 void Add(Platform::String ^ key, long long value);
void Add(std::wstring const & key, long value);
public void Add (string key, long value);
override this.Add : string * int64 -> unit
Public Sub Add (key As String, value As Long)

Parameters

key
String

The key of the element to add.

value
Int64

The value of the element to add.

Applies to

Add(String, Decimal)

Adds an element with the specified key and value into the Hashtable.

public:
 void Add(System::String ^ key, System::Decimal value);
public void Add (string key, decimal value);
override this.Add : string * decimal -> unit
Public Sub Add (key As String, value As Decimal)

Parameters

key
String

The key of the element to add.

value
Decimal

The value of the element to add.

Applies to