Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
0c62b9a
Always build ConsoleHost as top project
andyleejordan May 2, 2016
ad9c408
Make ConsoleHost emit powershell executable
andyleejordan May 2, 2016
2d2d58c
Make ConsoleHost/AssemblyInfo portable
andyleejordan May 2, 2016
6f425d0
Make ConsoleHost deploy profiles and native libraries
andyleejordan May 2, 2016
2f73af5
Remove native host dependency for ConsoleHost
andyleejordan May 2, 2016
8021247
Guard AmsiUtils in SessionState Init
andyleejordan May 2, 2016
04f551f
Don't build MshHostMshSnapin
andyleejordan May 2, 2016
602c7c3
Don't build EngineInstaller
andyleejordan May 2, 2016
3cd0d75
Don't build ConsoleControl
andyleejordan May 2, 2016
702082f
Guard use of ConsoleControl in ConsoleHost
andyleejordan May 2, 2016
02e9f10
Guard use of ConsoleControl in ConsoleHostUserInterface
andyleejordan May 2, 2016
8af7d5f
Guard use of ConsoleControl in ConsoleHostRawUserInterface
andyleejordan May 2, 2016
2e71a09
Use ~/.powershell for ConsoleHost profile on Linux
andyleejordan May 2, 2016
78dd93c
Build PSReadLine for ConsoleHost
andyleejordan May 2, 2016
849ea50
Load PSReadLine by correct name
andyleejordan May 2, 2016
c4bfc52
Migrate ConsoleHost .gitignore
andyleejordan May 4, 2016
d8b2d1f
Fix command-line parser to support --parameters
andyleejordan May 5, 2016
dca17ac
Migrate ConsoleHost tests
andyleejordan May 5, 2016
5c0d17e
Update ConsoleHost tests
andyleejordan May 5, 2016
8435ed7
Fix PSReadLine for net451 build
andyleejordan May 5, 2016
658f3e0
Update xUnit project to use ConsoleHost
andyleejordan May 5, 2016
fc9aa4c
Make ConsoleHost internals visible to powershell-tests
andyleejordan May 5, 2016
4234b3d
Remove CoreConsoleHost from xUnit tests
andyleejordan May 5, 2016
0012fa9
Remove deprecated Listener tests
andyleejordan May 5, 2016
7c80035
Skip xUnit tests not yet ported to OS X
andyleejordan May 5, 2016
7f9052c
Remove platform tests
andyleejordan May 5, 2016
72b763a
Fix ConsoleHost on Windows CoreCLR build
andyleejordan May 9, 2016
a1a722c
Add powershell project shim
andyleejordan May 9, 2016
630eb69
Add managed entrance for powershell project
andyleejordan May 9, 2016
1a61837
Migrate CoreConsoleHost/Modules
andyleejordan May 9, 2016
6d3c42a
Migrate profile
andyleejordan May 9, 2016
97ea930
Add readme to src/powershell
andyleejordan May 9, 2016
eee564e
Delete deprecated CoreConsoleHost project
andyleejordan May 9, 2016
533a5e3
Import System.Console In/Out/Error stream changes
lzybkr May 11, 2016
c3eaf9a
Mark as pending tests not working with ConsoleHost
andyleejordan May 6, 2016
7f491be
Fix AppVeyor to use Get-PSOutput
andyleejordan May 11, 2016
e387961
Add -noprofile to Start-PSPester
andyleejordan May 11, 2016
aa8dc7c
Use -noprofile on AppVeyor
andyleejordan May 11, 2016
8c97fd1
Add ConsoleHost tests
lzybkr May 11, 2016
6d7b6a1
Skip complex prompting tests
andyleejordan May 11, 2016
0dc549e
Use -noninteractive on AppVeyor
andyleejordan May 11, 2016
86e8673
Don't build more unused code
andyleejordan May 12, 2016
fbc794b
Guard BufferSize for improper terminals
andyleejordan May 12, 2016
6cd7804
Mark redirected input test as pending on Windows
andyleejordan May 12, 2016
2fdf481
Clean up Set-PSDebug tests
andyleejordan May 12, 2016
fe53280
Fix Import-Alias tests
andyleejordan May 12, 2016
2712cea
Use Pending for tests that shouldn't be Skipped
andyleejordan May 12, 2016
d1c2a2c
Disable Set-PSDebug tests on AppVeyor
andyleejordan May 12, 2016
800fa4c
Remove env key from OS X build
andyleejordan May 13, 2016
fa86c89
Enable pre and post write in WriteToConsole
andyleejordan May 13, 2016
44028f0
Fix formatting and output when stdout is redirected
andyleejordan May 13, 2016
7e65fa4
Mark as pending Travis CI OS X failing tests
andyleejordan May 14, 2016
772ecb8
Rename OPEN flag to PORTABLE
andyleejordan May 17, 2016
7afe9aa
Say that the portable UI supports virtual terminal
andyleejordan May 17, 2016
b67d765
Use WrapSize for WindowSize when unavailable
andyleejordan May 17, 2016
64efb9d
Fix ReadLineWithTabCompletion port
andyleejordan May 17, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ matrix:
- os: osx
osx_image: xcode7.3
language: generic
env: PATH+=/usr/local/share/dotnet
git:
submodules: false
before_install:
Expand Down
8 changes: 4 additions & 4 deletions PowerShellGitHubDev.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ function New-PSOptions {
[switch]$FullCLR
)

$Top = if ($FullCLR) {
"$PSScriptRoot\src\Microsoft.PowerShell.ConsoleHost"
if ($FullCLR) {
$Top = "$PSScriptRoot/src/Microsoft.PowerShell.ConsoleHost"
} else {
"$PSScriptRoot/src/Microsoft.PowerShell.CoreConsoleHost"
$Top = "$PSScriptRoot/src/powershell"
}
Write-Verbose "Top project directory is $Top"

Expand Down Expand Up @@ -315,7 +315,7 @@ function Start-PSPester {
[string]$Directory = "$PSScriptRoot/test/powershell"
)

& (Get-PSOutput) -c "Invoke-Pester $Flags $Directory/$Tests"
& (Get-PSOutput) -noprofile -c "Invoke-Pester $Flags $Directory/$Tests"
if ($LASTEXITCODE -ne 0) {
throw "$LASTEXITCODE Pester tests failed"
}
Expand Down
8 changes: 4 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ test_script:
$ErrorActionPreference = 'Stop'
#
# CoreCLR
$env:CoreOutput = "$pwd\src\Microsoft.PowerShell.CoreConsoleHost\bin\Debug\netcoreapp1.0\win81-x64\publish"
$env:CoreOutput = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions -Publish))
Write-Host -Foreground Green 'Run CoreCLR tests'
$testResultsFile = "$pwd\TestsResults.xml"
& ("$env:CoreOutput\powershell.exe") -c "Invoke-Pester test/powershell -OutputFormat NUnitXml -OutputFile $testResultsFile"
& ("$env:CoreOutput\powershell.exe") -noprofile -noninteractive -c "Invoke-Pester test/powershell -OutputFormat NUnitXml -OutputFile $testResultsFile"
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile))
#
# FullCLR
$env:FullOutput = "$pwd\src\Microsoft.PowerShell.ConsoleHost\bin\Debug\net451"
$env:FullOutput = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions -FullCLR))
Write-Host -Foreground Green 'Run FullCLR tests'
$testResultsFileFullCLR = "$pwd\TestsResults.FullCLR.xml"
Start-DevPSGitHub -binDir $env:FullOutput -NoNewWindow -ArgumentList '-command', "Import-Module .\src\Modules\Pester; Invoke-Pester test/fullCLR -OutputFormat NUnitXml -OutputFile $testResultsFileFullCLR"
Start-DevPSGitHub -binDir $env:FullOutput -NoNewWindow -ArgumentList '-noprofile', '-noninteractive', '-command', "Import-Module .\src\Modules\Pester; Invoke-Pester test/fullCLR -OutputFormat NUnitXml -OutputFile $testResultsFileFullCLR"
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFileFullCLR))
#
# Fail the build, if tests failed
Expand Down
4 changes: 2 additions & 2 deletions mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -1187,12 +1187,12 @@
"src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Archive/ArchiveResources.psd1": "src/Modules/Microsoft.PowerShell.Archive/ArchiveResources.psd1",
"src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psd1": "src/Modules/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psd1",
"src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1": "src/Modules/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1",
"src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Diagnostics/CoreClr/Microsoft.PowerShell.Diagnostics.psd1": "src/Microsoft.PowerShell.CoreConsoleHost/Modules/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1",
"src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Diagnostics/CoreClr/Microsoft.PowerShell.Diagnostics.psd1": "src/powershell/Modules/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1",
"src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1": "src/Microsoft.PowerShell.ConsoleHost/Modules/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1",
"src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1": "src/Modules/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1",
"src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1": "src/Modules/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1",
"src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1": "src/Modules/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1",
"src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Utility/CoreClr/Microsoft.PowerShell.Utility.psd1": "src/Microsoft.PowerShell.CoreConsoleHost/Modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1",
"src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Utility/CoreClr/Microsoft.PowerShell.Utility.psd1": "src/powershell/Modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1",
"src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1": "src/Microsoft.PowerShell.ConsoleHost/Modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1",
"src/monad/monad/miscfiles/modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1": "src/Modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1",
"src/monad/monad/miscfiles/modules/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1": "src/Modules/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1",
Expand Down
14 changes: 10 additions & 4 deletions src/Microsoft.PowerShell.ConsoleHost/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,33 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
#if !CORECLR
using System.Runtime.ConstrainedExecution;
using System.Security.Permissions;
#endif

#if CORECLR
[assembly:AssemblyCulture("")]
[assembly:NeutralResourcesLanguage("en-US")]

[assembly:InternalsVisibleTo("powershell-tests")]
#else
[assembly:AssemblyConfiguration("")]
[assembly:AssemblyInformationalVersionAttribute (@"10.0.10011.16384")]
[assembly:ReliabilityContractAttribute(Consistency.MayCorruptAppDomain, Cer.MayFail)]
[assembly:AssemblyTitle("Microsoft.PowerShell.ConsoleHost")]
[assembly:AssemblyDescription("Microsoft Windows PowerShell Console Host")]

[assembly:System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5")]
[assembly:System.Reflection.AssemblyFileVersion("10.0.10011.16384")]
[assembly:AssemblyKeyFileAttribute(@"..\signing\visualstudiopublic.snk")]
[assembly:System.Reflection.AssemblyDelaySign(true)]
#endif

[assembly:System.Runtime.InteropServices.ComVisible(false)]
[assembly:System.Reflection.AssemblyVersion("3.0.0.0")]
[assembly:System.Reflection.AssemblyProduct("Microsoft (R) Windows (R) Operating System")]
[assembly:System.Reflection.AssemblyCopyright("Copyright (c) Microsoft Corporation. All rights reserved.")]
[assembly:System.Reflection.AssemblyCompany("Microsoft Corporation")]
[assembly:System.Reflection.AssemblyFileVersion("10.0.10011.16384")]
[assembly:AssemblyKeyFileAttribute(@"..\signing\visualstudiopublic.snk")]
[assembly:System.Reflection.AssemblyDelaySign(true)]

internal static class AssemblyStrings
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ internal uint ExitCode
}
}

internal bool ReadFromStdin
internal bool ExplicitReadCommandsFromStdin
{
get
{
Dbg.Assert(dirty, "Parse has not been called yet");

return readFromStdin;
return explicitReadCommandsFromStdin;
}
}

Expand Down Expand Up @@ -365,6 +365,12 @@ private void ParseHelper(string[] args)

switchKey = switchKey.Substring(1);

// chop off the second dash so we're agnostic wrt specifying - or --
if (SpecialCharacters.IsDash(switchKey[0]))
{
switchKey = switchKey.Substring(1);
}

if (MatchSwitch(switchKey, "help", "h") || MatchSwitch(switchKey, "?", "?"))
{
showHelp = true;
Expand Down Expand Up @@ -482,7 +488,7 @@ private void ParseHelper(string[] args)
{
// the arg to -file is -, which is secret code for "read the commands from stdin with prompts"

readFromStdin = true;
explicitReadCommandsFromStdin = true;
noPrompt = false;
}
else
Expand Down Expand Up @@ -844,7 +850,7 @@ private bool ParseCommand(string[] args, ref int i, bool noexitSeen, bool isEnco
{
// the arg to -command is -, which is secret code for "read the commands from stdin with no prompts"

readFromStdin = true;
explicitReadCommandsFromStdin = true;
noPrompt = true;

++i;
Expand All @@ -859,7 +865,7 @@ private bool ParseCommand(string[] args, ref int i, bool noexitSeen, bool isEnco
return false;
}

if (!parent.IsStandardInputRedirected)
if (!Console.IsInputRedirected)
{
ui.WriteErrorLine(CommandLineParameterParserStrings.StdinNotRedirected);
showHelp = true;
Expand Down Expand Up @@ -968,7 +974,7 @@ private bool CollectArgs(string[] args, ref int i)
// default is sta.
private bool? staMode = null;
private bool noExit = true;
private bool readFromStdin;
private bool explicitReadCommandsFromStdin;
private bool noPrompt;
private string commandLineCommand;
private bool wasCommandEncoded;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if !PORTABLE
/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/
Expand Down Expand Up @@ -3685,4 +3686,4 @@ internal enum CHAR_INFO_Attributes : uint
private static PSTraceSource tracer = PSTraceSource.GetTracer("ConsoleControl", "Console control methods");
}
} // namespace

#endif
Loading