Download PowerShell-master/test/powershell/Host/Read-Host.Tests.ps1 from MegaBites-AI/Windows-powershell: direct link, hf CLI and curl.
- Browser
- Download file 933 Bytes
-
https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/powershell/Host/Read-Host.Tests.ps1
- Command line
-
hf download hf://datasets/MegaBites-AI/Windows-powershell/PowerShell-master/test/powershell/Host/Read-Host.Tests.ps1
-
curl -L -o Read-Host.Tests.ps1 https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/powershell/Host/Read-Host.Tests.ps1
933 Bytes
| # Copyright (c) Microsoft Corporation. | |
| # Licensed under the MIT License. | |
| Describe "Read-Host" -Tags "Slow","Feature" { | |
| Context "[Console]::ReadKey() implementation on non-Windows" { | |
| BeforeAll { | |
| $powershell = Join-Path -Path $PSHOME -ChildPath "pwsh" | |
| $assetsDir = Join-Path -Path $PSScriptRoot -ChildPath assets | |
| if ($IsWindows) { | |
| $ItArgs = @{ skip = $true } | |
| } elseif (-not (Get-Command expect -ErrorAction Ignore)) { | |
| $ItArgs = @{ pending = $true } | |
| } else { | |
| $ItArgs = @{ } | |
| } | |
| $expectFile = Join-Path $assetsDir "Read-Host.Output.expect" | |
| if (-not $IsWindows) { | |
| chmod a+x $expectFile | |
| } | |
| } | |
| It @ItArgs "Should output correctly" { | |
| & $expectFile $powershell | Out-Null | |
| $LASTEXITCODE | Should -Be 0 | |
| } | |
| } | |
| } | |