Windows-powershell / PowerShell-master /test /powershell /engine /Basic /assets /WriteConsoleOut.ps1
Download PowerShell-master/test/powershell/engine/Basic/assets/WriteConsoleOut.ps1 from MegaBites-AI/Windows-powershell: direct link, hf CLI and curl.
- Browser
- Download file 437 Bytes
-
https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/powershell/engine/Basic/assets/WriteConsoleOut.ps1
- Command line
-
hf download hf://datasets/MegaBites-AI/Windows-powershell/PowerShell-master/test/powershell/engine/Basic/assets/WriteConsoleOut.ps1
-
curl -L -o WriteConsoleOut.ps1 https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/powershell/engine/Basic/assets/WriteConsoleOut.ps1
437 Bytes
| # 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() | |
| } | |