Commit graph

1459 commits

Author SHA1 Message Date
PowerShell Team c3ce30e34a Refactoring - use is operator instead of GetType() where possible 2016-08-03 12:14:28 -07:00
PowerShell Team 22d2273ce4 Refactoring - use ?? in more places 2016-08-03 12:14:28 -07:00
PowerShell Team 85d6e9f022 Refactoring - adjust modifiers declaration order 2016-08-03 12:14:28 -07:00
PowerShell Team ae8d2ed794 Refactor - convert to auto-property
Mostly using R# to automatically refactor, with some manual
fixups where it wouldn't work automatically (e.g. xml comments
on fields) or some it seemed to miss.

Some minor code reformatting was also done on properties near
other stuff I was manually inspecting.
2016-08-03 12:14:28 -07:00
PowerShell Team bc4901bd59 Remove unused using statements 2016-08-03 12:06:06 -07:00
Jason Shirk (POWERSHELL) 38ab0f4d73 update csproj references 2016-08-03 12:06:06 -07:00
Alex Jordan b1ea06aaef Merge pull request #1593 from PowerShell/ealexjordan/pscolors
Ealexjordan/pscolors
2016-08-03 10:37:20 -07:00
Sergei Vorobev 25c89310a4 Bump MMI dependency to alpha04
alpha04 has following changes:
- libmi.so is not included in this package. It will be brough
  as a separate nuget package later.
- all unix runtimes are replaced by generic unix runtimes to
  enable easier builds on new unix platforms.
2016-08-02 17:54:07 -07:00
Sergei Vorobev b654b7d4b1 Merge pull request #1501 from PowerShell/jameswtruher/CmdletTestMigration
Jameswtruher/cmdlet test migration
2016-08-02 14:09:10 -07:00
Paul Allen b529951598 Merge pull request #1604 from PowerShell/split-psrp-shared-library
split the wsman apis into client/server shared libraries
2016-08-02 13:57:07 -07:00
Sergei Vorobev f48bb2fcaa Merge pull request #1606 from PowerShell/vors/author
Remove author tag from all project.json files
2016-08-02 13:29:43 -07:00
Andy Schwartzmeyer f5502bcddc Merge pull request #1605 from PowerShell/vors/resgen
C#-based resgen
2016-08-02 12:48:39 -07:00
Sergei Vorobev 78c9da25fa Merge pull request #1601 from PowerShell/travisez13/BuildWSManInCore
Compile WSMan binaries when compiling for dot net core
2016-08-02 12:47:31 -07:00
Sergei Vorobev fb2770392d Remove author tag from all project.json files 2016-08-02 12:39:30 -07:00
Jason Shirk cfba7537f3 Merge pull request #1599 from PowerShell/error-stream
Error stream
2016-08-02 12:15:13 -07:00
James Truher d23a5fddc7 fix Archive module to work correctly when the DirectorySeparatorChar is "/"
rather than use either "/" or "\", just use [io.path]::DirectorySeparatorChar
2016-08-02 12:05:24 -07:00
Sergei Vorobev db3274f103 Add dotnet-based resgen 2016-08-02 11:45:37 -07:00
Travis Plunk 724c53ced8 Compile WSMan binaries when compiling for dot net core 2016-08-02 11:45:11 -07:00
Paul Allen a7f58b2026 split the wsman apis into client/server shared libraries 2016-08-02 11:40:09 -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
Alex Jordan e2846379b8 Fixing default and error colors for PSReadLine 2016-08-02 00:16:54 -07:00
Sergei Vorobev 161940c9aa Don't apply red color to error stream output 2016-08-01 18:40:50 -07:00
Sergei Vorobev a12eff96c0 Change formatter for ErrorRecord
Fix #1465

On Linux, it's common to use error stream (2) as an information stream.
There is no errors in this case, it's just a way to report info.
When PowerShell redirects error stream, it wraps all output from stream 2
in NativeCommandError ErrorRecord.

That doesn't happen for interactive experience (when there is no
redirection), but it shows up in logs, scripting and non-console
powershell hosts (i.e. PowerShell ISE).

Here we change the formatter, so we are keeping the ErrorRecords
objects, but we are changing their default representation.

If it's a NativeCommandError, we don't use the regular ErrorRecord
formatter. It allows us keep ErrorRecord object,
but in redirection case it will look exectly like on the screen.

Also, we are change NativeCommandErrorMessage to use one line per
ErrorRecord to enable this scenario.
2016-08-01 18:39:57 -07:00
Jason Shirk 9742b64170 Merge pull request #1591 from lzybkr/code_formatting
Code formatting
2016-08-01 16:46:05 -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
PowerShell Team 403ae3f53f Initial run of code formatter
I (Jason Shirk) ran https://github.com/dotnet/codeformatter with the default rules, basically:

    codeformatter /nocopyright "/c:DEBUG,UNIX,CORECLR" @files.rsp

This caused a few problems building, which were fixed up manually.

Notable changes:

`this.` is removed unless needed to disambiguate.
private instance fields are renamed to have a `_` prefix.
private static fields are renamed to have a `s_` prefix.

I left some projects alone (like PackageManagement) and also left some generated code alone.
2016-08-01 15:57:03 -07:00
Mike Richmond 19138f3f62 Fixing reverse PInvoke worker callback pointer structure layout to synchronize it between managed and unmanaged code. 2016-08-01 15:02:52 -07:00
John Kordich a0339d4a12 Linux DSC MOF compilation changes 2016-07-29 16:29:52 -07:00
Sergei Vorobev e9606ac793 Change MMI package to alpha02 2016-07-29 12:24:02 -07:00
Quoc Truong a56b29c3a0 Merge pull request #1557 from PowerShell/quoct/addpseditiontag
Add a tag to check for PSEdition for Find-Packageprovider
2016-07-29 11:38:51 -07:00
Dongbo Wang 034f9ba46d Merge pull request #1570 from PowerShell/test/fix-master
Revert back to old MMI package, until we fix regression
2016-07-29 09:25:02 -07:00
Jason Shirk 0513425ff9 Merge pull request #1566 from PowerShell/andschwa/chars
Fix PSReadLine custom key binding on Linux
2016-07-29 09:10:10 -07:00
Sergei Vorobev dcde9bd583 Revert back to old MMI package, until we fix regression 2016-07-29 08:49:33 -07:00
Sergei Vorobev d5f3fd3f83 Fix Microsoft.PowerShell.GraphicalHost/map.json 2016-07-28 23:20:22 -07:00
Sergei Vorobev 3e6179112b Fix Microsoft.PowerShell.Commands.Utility/map.json 2016-07-28 23:15:19 -07:00
Andrew Schwartzmeyer 59624e9b2f Fix comparison for default ConsoleKey 2016-07-28 21:51:03 -07:00
Andrew Schwartzmeyer 554ef0b780 Use GetCharFromConsoleKey on Windows
Due to virtual key codes on Windows, simple chords like Ctrl+] are not
recognized as such. Instead, the ConsoleKey is Oem6, and the KeyChar is
an control code.
2016-07-28 21:51:02 -07:00
Andrew Schwartzmeyer d5b339fb5d Revert changes made to GetGestureString
Given the use of key.KeyChar, the original implementation is now
portable.
2016-07-28 21:35:19 -07:00
Andrew Schwartzmeyer 1facd95f1e Implement TryParseCharLiteral for Linux 2016-07-28 21:35:19 -07:00
Andrew Schwartzmeyer 75b086402a Remove GetCharFromConsoleKey
The ConsoleKey enum does not necessarily cover all possible chars.
Moreover, the times we need to obtain this info, we already have it.
2016-07-28 21:35:19 -07:00
Sergei Vorobev 0ac0f1962e Replace Uri.UriSchemeHttps by https in PackageListParser
Uri.UriSchemeHttps is not available on CoreCLR
2016-07-28 18:02:24 -07:00
PowerShell Team 0dd425da19 Integrate changes between [SD:717473] and [SD:725290] 2016-07-28 18:02:24 -07:00
Sergei Vorobev 2280bea11e Consolidate map.json files under Microsoft.PowerShell.Commands.Utility
Fix #1489
2016-07-28 18:02:24 -07:00
Dongbo Wang 14433e6b1f Update project.json files to keep sync with the new MMI nuget package 2016-07-28 17:07:57 -07:00
Andy Schwartzmeyer d691712c01 Merge pull request #1554 from PowerShell/vors/env
Make Get-Item env: case-aware on Unix
2016-07-28 14:50:39 -07:00
quoctruong 1de1012f05 Add a tag to check for PSEdition for Find-Packageprovider 2016-07-28 14:39:31 -07:00
Sergei Vorobev a704a53f08 Make Get-Item env: case-aware on Unix
Fix #1196
2016-07-28 14:19:36 -07:00
Sergei Vorobev 845bc34f5a Update src/Modules/README.md 2016-07-28 12:38:24 -07:00
Sergei Vorobev 8889cada69 Update map.json in src/Modules 2016-07-28 12:36:34 -07:00
Sergei Vorobev 7a010bc407 Move Microsoft.PowerShell.ODataUtils to Full windows only modules
Fix #1548
2016-07-28 12:35:21 -07:00