Hex Parameter Assignment Of Deed

On By In 1

Format-Hex

Displays a file or other input as hexadecimal.

Syntax

Description

The Format-Hex cmdlet displays a file or other input as hexadecimal values. To determine the offset of a character from the output, add the number at the leftmost of the row to the number at the top of the column for that character.

This cmdlet can help you determine the file type of a corrupted file or a file which may not have a file name extension. Run this cmdlet, and then inspect the results for file information.

Examples

Example 1: Get the hexadecimal representation of a string

This command returns the hexadecimal representation of the string Hello World.

Example 2: Investigate a file type

This command converts the file that is named temp.t7f to hexadecimal. In this example, a file that has the unfamiliar file name extension .t7f is actually a PDF file. The first few bytes of the header contain that information.

Required Parameters

-InputObject

Specifies the objects to be formatted. Enter a variable that contains the objects or type a command or expression that gets the objects.

Type:Object
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

-LiteralPath

Specifies an array of literal paths of items. This parameter does not accept wildcard characters. To use wildcard characters, specify the Path parameter instead.

If this parameter includes escape characters, enclose the path in single quotation marks. Windows PowerShell does not interpret any characters in a single quoted string as escape sequences. For more information, type .

Type:String[]
Aliases:PSPath
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Path

Specifies an array of paths of items. This cmdlet returns a hexadecimal representation of the items that this parameter specifies.

Use a dot (.) to specify the current location. Use the wildcard character (*) to specify all the items in the current location.

Type:String[]
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Encoding

Specifies the type of character encoding used in the file that this cmdlet formats as hexadecimal. The acceptable values for this parameter are:

  • Ascii
  • UTF32
  • UTF7
  • UTF8
  • BigEndianUnicode
  • Unicode

The default value is Unicode.

Type:String
Parameter Sets:Ascii, UTF32, UTF7, UTF8, BigEndianUnicode, Unicode
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Raw

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String

You can pipe a string to this cmdlet.

Outputs

Microsoft.PowerShell.Commands.ByteCollection

This cmdlet returns a ByteCollection. This object represents a collection of bytes. It includes methods that convert the collection of bytes to a string formatted like each line of output returned by Format-Hex. If you specify the Path or LiteralPath parameter, the object also contains the path of the file that contains each byte.

Related Links

Если Дэвид не добьется успеха, а ключ Танкадо попадет в чьи-то руки… Коммандеру не нужно было договаривать. Сьюзан и так его поняла. Пока файл «Цифровой крепости» не подменен модифицированной версией, копия ключа, находившаяся у Танкадо, продолжает представлять собой огромную опасность.

- Когда мы внесем эту поправку, - добавил Стратмор, - мне будет все равно, сколько ключей гуляет по свету: чем их больше, тем забавнее.

0 comments

Leave a Reply

Your email address will not be published. Required fields are marked *