RequestExtensions.ToByteArray Method

Encodes a string as an array of UTF8 bytes. This element is introduced in Windows PowerShell 5.0.

Namespace: Microsoft.OneGet.MetaProvider.PowerShell
Assembly: Microsoft.OneGet.MetaProvider.PowerShell (in Microsoft.OneGet.MetaProvider.PowerShell.dll)

Usage

'Usage
Dim text As String
Dim returnValue As Byte()

returnValue = RequestExtensions.ToByteArray(text)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function ToByteArray ( _
    text As String _
) As Byte()
[ExtensionAttribute] 
public static byte[] ToByteArray (
    string text
)
[ExtensionAttribute] 
public:
static array<unsigned char>^ ToByteArray (
    String^ text
)
/** @attribute ExtensionAttribute() */ 
public static byte[] ToByteArray (
    String text
)
ExtensionAttribute 
public static function ToByteArray (
    text : String
) : byte[]

Parameters

  • text
    The text.

Return Value

Returns Byte.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Target Platforms

See Also

Reference

RequestExtensions Class
RequestExtensions Members
Microsoft.OneGet.MetaProvider.PowerShell Namespace