Commit Graph
45 Commits
Author SHA1 Message Date
Jason Shirk (POWERSHELL) ca2dce3537 Improve coverage for Write-Information output 2016-11-14 14:03:30 -08:00
Jason Shirk (POWERSHELL) 0d3021c5ca Delay initialize some properties in InformationRecord
An InformationRecord instance is created when calling Write-Host,
but many of the properties aren't read.

It can be expensive to initialize some of those properties, so
the code has been changed to initialize those properties on first access.
2016-11-14 14:03:30 -08:00
Jason Shirk (POWERSHELL) acdf1c1d44 Fix LengthInBufferCells test for downlevel
When running on systems that do not support a virtual terminal,
the tests was incorrectly assuming escape sequences were removed.

The fix is to expect different results depending on whether or not
the host supports virtual terminal mode.
2016-11-14 13:59:43 -08:00
Jason Shirk (POWERSHELL) 9b20875d6f Test that pipeline isn't blocked when running windows exes 2016-11-01 14:15:31 -07:00
Jason Shirk (POWERSHELL) f65312dbc0 Don't block pipeline when running windows exes 2016-11-01 14:15:31 -07:00
Jason Shirk (POWERSHELL) 39db1ec402 Add capacity test for initialsessionstate 2016-09-28 16:54:31 -07:00
Jason Shirk (POWERSHELL) f252683e90 Remove SessionStateOverflowException
This exception is no longer used by PowerShell, so it has been removed.

It is a public api, so removing it risks breaking somebody. Nobody has any reason
to catch or throw this exception, so it seems safe to remove, but I decided to
be conservative and keep it for Windows PowerShell.  It seems safe enough to remove
in Nano.
2016-09-28 15:47:08 -07:00
Jason Shirk (POWERSHELL) c7951e13c0 Remove most Maximum* capacity variables
MaximumErrorCount is fixed at 256 (we may want to consider an environment variable to make this bigger)

MaximumAliasCount, MaximumDriveCount, MaximumFunctionCount, and MaximumVariableCount have been removed.
2016-09-26 15:16:35 -07:00
Jason Shirk (POWERSHELL) 07b0964be4 Fix hang when reading stdin from ruby
This is a workaround for a full clr issue that causes a hang when calling PowerShell from ruby.
They use named pipes instead of anonymous pipes, and for some reason that triggers the hang.
2016-09-26 11:22:28 -07:00
Jason Shirk (POWERSHELL) 1913244fad Fix powershell -Command - handling of backspace
PowerShell can be started with input redirected in different scenarios.

`powershell -Command -` is one scenario where commands are sent to
PowerShell, but this is not a interactive shell scenario, it's really
a server to run commands from some other process.

`powershell -File -` or just regular redirected input means PowerShell
is an interactive shell, but command line editing must be done via
the redirected standard input handle instead of interacting directly
with a console handle.

In this scenario, we want to provide a good editing experience. Today,
we provide the bare minimum, supporting backspace but no cursor movement.

The bug here is that backspace was treated as a backspace in the server mode
but should not have been.
2016-09-21 15:01:33 -07:00
Jason Shirk (POWERSHELL) f095320787 Fix powershell -Command - to not ignore last command
If the last command sent via stdin did not have a newline,
the command was ignored. This would happen when stdin was closed.
2016-09-21 14:42:16 -07:00
Jason Shirk (POWERSHELL) 231f34b472 Cleanup mis-formatting of preprocessor directives 2016-08-12 15:29:37 -07:00
Jason Shirk (POWERSHELL) cf40937552 Fix remoting break caused by refactoring
Remoting apparently depends on the names of private fields
not changing between versions of PowerShell.

Because of this, these refactorings broke remoting:
* rename private fields
* convert to auto-property
2016-08-05 17:55:49 -07:00
Jason Shirk (POWERSHELL) 420155517a Add serialization test of SemanticVersion 2016-08-03 13:21:42 -07:00
Jason Shirk (POWERSHELL) 2b70837d98 Set remoting PSVersionTable private data in a downlevel compatible manner 2016-08-03 13:21:42 -07:00
Jason Shirk (POWERSHELL) 2b74b89f76 Add serialization support for SemanticVersion 2016-08-03 13:20:07 -07:00
Jason Shirk (POWERSHELL) 38ab0f4d73 update csproj references 2016-08-03 12:06:06 -07:00
Jason Shirk (POWERSHELL) 75eab56e21 csproj fixes
- add some missing references
- fix assembly name so InternalsVisibleTo works
2016-08-02 10:50:51 -07:00
Jason Shirk (POWERSHELL) c34ef6141b Use nameof() where we use reflection
We use a lot of reflection, and when you rename a member (e.g. when running
the code formatter), it doesn't detect references where you're using reflection.

By using nameof(), we can now find these references (e.g. a build break) instead
of failing at runtime.
2016-08-01 15:58:17 -07:00
Jason Shirk (POWERSHELL) 9a20bf6f97 Change $PSVersionTable.PSVersion to 6.0.0-alpha 2016-07-27 10:53:11 -07:00
Jason Shirk (POWERSHELL) 8e8ade947d Add SemanticVersion tests 2016-07-27 10:53:11 -07:00
Jason Shirk (POWERSHELL) be8e39782f Add SemanticVersion type 2016-07-27 10:53:11 -07:00
Jason Shirk d4c8688c13 Update issue labels doc 2016-07-25 21:57:01 -07:00
Jason Shirk (POWERSHELL) 8fcd8065be Coding guidelines first cut 2016-07-25 21:57:00 -07:00
Jason Shirk (POWERSHELL) 673dd2c355 Change preprocessor macro LINUX to UNIX 2016-07-22 10:49:45 -07:00
Jason Shirk (POWERSHELL) 7b3ace4be4 Use one fragment per line in Markdown 2016-07-21 23:19:35 -07:00
Jason Shirk d300bf0ef7 Add README 2016-07-21 10:03:08 -07:00
Jason Shirk 3fb9315fce cleanup demo script 2016-07-21 09:56:14 -07:00
Jason Shirk 444769cb6b Add -Force to Remove-CronJob 2016-07-21 09:55:48 -07:00
Jason Shirk d7d516a066 Don't use Invoke-Expression 2016-07-21 09:40:03 -07:00
Jason Shirk af27a06f89 Fix Remove-CronTab to only remove the correct job(s) 2016-07-21 09:18:28 -07:00
Jason Shirk 3dafae5357 Move crontab demo to it's own directory
Also change CronTab.psd1 encoding to ASCII
2016-07-21 08:51:09 -07:00
Jason Shirk ec1369f1dc Add argument completion for -UserName 2016-07-21 08:44:36 -07:00
Jason Shirk ab5bda18e0 Fix removing all lines from crontab 2016-07-20 13:49:44 -07:00
Jason Shirk 0be252ec0e Use class instead of PSObject for Get/Remove-CronJob 2016-07-19 12:27:33 -07:00
Jason Shirk (POWERSHELL) c0b16d7bf5 Skip tone/duration on beep on LINUX 2016-07-07 12:07:52 -07:00
Jason Shirk (POWERSHELL) 372d69583f Only use CHAR_INFO on Windows
CHAR_INFO has 4 bits for ConsoleColor.  On Linux, ConsoleColor is sometimes -1 (unknown),
which is a 17th possible value for ConsoleColor, which can't be represented in CHAR_INFO.

To fix this, I've introduced a bigger type that gets converted to CHAR_INFO when necessary.
2016-07-07 12:07:52 -07:00
Jason Shirk (POWERSHELL) e79c62f9ec Introduce TTYConsole for UNIX 2016-07-07 12:07:52 -07:00
Jason Shirk (POWERSHELL) 8e234322c4 First stab addressing CORECLR vs. LINUX in PSReadLine 2016-07-07 12:07:52 -07:00
Jason Shirk (POWERSHELL) efc83bbaa2 Add csproj files and sln for editing but not building 2016-07-05 10:27:41 -07:00
Jason Shirk (POWERSHELL) 07501f1d3a Add *.csproj.user to .gitignore 2016-07-01 17:37:19 -07:00
Jason Shirk (POWERSHELL) dc1d672a86 Fix Measure-Object -Property w/ wildcards
Fixes #1215
2016-06-30 18:16:37 -07:00
Jason Shirk (POWERSHELL) 4269398379 Fix Split-Path -NoQualifier for Unix paths 2016-06-30 12:59:04 -07:00
Jason Shirk (POWERSHELL) bfc5b7e836 Revert Unix specific Split-Path -Qualifier code
The -Qualifier code for Split-Path made some incorrect assumptions:

* That a path only referred to the file system
* That drives cannot be used on Unix systems

These assumptions were both wrong, so I've reverted the change so we
do not have any Unix specific code in Split-Path now.

Fixes #1176
2016-06-29 14:12:29 -07:00
Jason Shirk (POWERSHELL) 283d596a20 Import local Pester version before running tests 2016-06-24 14:03:30 -07:00