RequestExtensions.ProtectForMachine Method

Encrypts a string with the machine key and the specified salt 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)


Dim text As String
Dim salt As String
Dim returnValue As IEnumerable(Of Byte)

returnValue = RequestExtensions.ProtectForMachine(text, salt)


<ExtensionAttribute> _
Public Shared Function ProtectForMachine ( _
    text As String, _
    salt As String _
) As IEnumerable(Of Byte)
public static IEnumerable<byte> ProtectForMachine (
    string text,
    string salt
static IEnumerable<unsigned char>^ ProtectForMachine (
    String^ text, 
    String^ salt
/** @attribute ExtensionAttribute() */ 
public static IEnumerable<byte> ProtectForMachine (
    String text, 
    String salt
public static function ProtectForMachine (
    text : String, 
    salt : String
) : IEnumerable<byte>


  • text
    The text.
  • salt
    The salt.

Return Value

Returns IEnumerable.

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.


Target Platforms

See Also


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