mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-14 21:59:20 +00:00
23 lines
437 B
PowerShell
23 lines
437 B
PowerShell
# Copyright (c) Microsoft Corporation.
|
|||
|
|
# Licensed under the MIT License.
|
||
|
|
|
||
|
|
[CmdletBinding()]
|
||
|
|
param (
|
||
|
|
[Parameter(Mandatory)]
|
||
|
|
[string]
|
||
|
|
$Value,
|
||
|
|
|
||
|
|
[Parameter(Mandatory)]
|
||
|
|
[string]
|
||
|
|
$Encoding
|
||
|
|
)
|
||
|
|
|
||
|
|
$enc = [System.Text.Encoding]::GetEncoding($Encoding)
|
||
|
|
$data = $enc.GetBytes($Value)
|
||
|
|
|
||
|
|
$outStream = [System.Console]::OpenStandardOutput()
|
||
|
|
try {
|
||
|
|
$outStream.Write($data, 0, $data.Length)
|
||
|
|
} finally {
|
||
|
|
$outStream.Dispose()
|
||
|
|
}
|