|
| 1 | +--- |
| 2 | +external help file: Convert-help.xml |
| 3 | +Module Name: Convert |
| 4 | +online version: https://austoonz.github.io/Convert/functions/ConvertFrom-ByteArrayToString/ |
| 5 | +schema: 2.0.0 |
| 6 | +--- |
| 7 | + |
| 8 | +# ConvertFrom-ByteArrayToString |
| 9 | + |
| 10 | +## SYNOPSIS |
| 11 | +Converts a byte array to a string using the specified encoding. |
| 12 | + |
| 13 | +## SYNTAX |
| 14 | + |
| 15 | +``` |
| 16 | +ConvertFrom-ByteArrayToString [-ByteArray] <Byte[]> [[-Encoding] <String>] [-ProgressAction <ActionPreference>] |
| 17 | + [<CommonParameters>] |
| 18 | +``` |
| 19 | + |
| 20 | +## DESCRIPTION |
| 21 | +Converts a byte array to a string using the specified encoding. |
| 22 | +This is the inverse operation of ConvertFrom-StringToByteArray. |
| 23 | + |
| 24 | +## EXAMPLES |
| 25 | + |
| 26 | +### EXAMPLE 1 |
| 27 | +``` |
| 28 | +$bytes = [byte[]]@(72, 101, 108, 108, 111) |
| 29 | +ConvertFrom-ByteArrayToString -ByteArray $bytes |
| 30 | +``` |
| 31 | + |
| 32 | +Hello |
| 33 | + |
| 34 | +### EXAMPLE 2 |
| 35 | +``` |
| 36 | +$bytes = ConvertFrom-StringToByteArray -String 'Hello, World!' |
| 37 | +ConvertFrom-ByteArrayToString -ByteArray $bytes |
| 38 | +``` |
| 39 | + |
| 40 | +Hello, World! |
| 41 | + |
| 42 | +### EXAMPLE 3 |
| 43 | +``` |
| 44 | +$bytes1, $bytes2 | ConvertFrom-ByteArrayToString -Encoding 'UTF8' |
| 45 | +``` |
| 46 | + |
| 47 | +Converts multiple byte arrays from the pipeline to strings. |
| 48 | + |
| 49 | +## PARAMETERS |
| 50 | + |
| 51 | +### -ByteArray |
| 52 | +The array of bytes to convert. |
| 53 | + |
| 54 | +```yaml |
| 55 | +Type: Byte[] |
| 56 | +Parameter Sets: (All) |
| 57 | +Aliases: |
| 58 | + |
| 59 | +Required: True |
| 60 | +Position: 1 |
| 61 | +Default value: None |
| 62 | +Accept pipeline input: True (ByPropertyName, ByValue) |
| 63 | +Accept wildcard characters: False |
| 64 | +``` |
| 65 | +
|
| 66 | +### -Encoding |
| 67 | +The encoding to use for conversion. |
| 68 | +Defaults to UTF8. |
| 69 | +Valid options are ASCII, BigEndianUnicode, Default, Unicode, UTF32, and UTF8. |
| 70 | +
|
| 71 | +```yaml |
| 72 | +Type: String |
| 73 | +Parameter Sets: (All) |
| 74 | +Aliases: |
| 75 | + |
| 76 | +Required: False |
| 77 | +Position: 2 |
| 78 | +Default value: UTF8 |
| 79 | +Accept pipeline input: False |
| 80 | +Accept wildcard characters: False |
| 81 | +``` |
| 82 | +
|
| 83 | +### -ProgressAction |
| 84 | +{{ Fill ProgressAction Description }} |
| 85 | +
|
| 86 | +```yaml |
| 87 | +Type: ActionPreference |
| 88 | +Parameter Sets: (All) |
| 89 | +Aliases: proga |
| 90 | + |
| 91 | +Required: False |
| 92 | +Position: Named |
| 93 | +Default value: None |
| 94 | +Accept pipeline input: False |
| 95 | +Accept wildcard characters: False |
| 96 | +``` |
| 97 | +
|
| 98 | +### CommonParameters |
| 99 | +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). |
| 100 | +
|
| 101 | +## INPUTS |
| 102 | +
|
| 103 | +## OUTPUTS |
| 104 | +
|
| 105 | +### [String] |
| 106 | +## NOTES |
| 107 | +
|
| 108 | +## RELATED LINKS |
| 109 | +
|
| 110 | +[https://austoonz.github.io/Convert/functions/ConvertFrom-ByteArrayToString/](https://austoonz.github.io/Convert/functions/ConvertFrom-ByteArrayToString/) |
| 111 | +
|
0 commit comments