Commit Graph
376 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
James Truher 1bbdaa7ea8 Change free/used calculation to be consistent across platforms
add a couple of tests to validate return values
2016-08-03 10:38:26 -07:00
James Truher 9597a47689 change linux diskfree calculations from using /bin/df as a source of data to [io.driveinfo] 2016-08-03 10:38:26 -07:00
James Truher fb953c16b8 fix for Get-PSDrive to get free and used space on Non-Windows systems 2016-08-03 10:38:26 -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
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
Jason Shirk cfba7537f3 Merge pull request #1599 from PowerShell/error-stream
Error stream
2016-08-02 12:15:13 -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
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
Sergei Vorobev dcde9bd583 Revert back to old MMI package, until we fix regression 2016-07-29 08:49:33 -07:00
PowerShell Team 0dd425da19 Integrate changes between [SD:717473] and [SD:725290] 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
Sergei Vorobev a704a53f08 Make Get-Item env: case-aware on Unix
Fix #1196
2016-07-28 14:19:36 -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) be8e39782f Add SemanticVersion type 2016-07-27 10:53:11 -07:00
Andrew Schwartzmeyer 41173a3b65 Rename IsCore to IsCoreCLR 2016-07-26 11:54:08 -07:00
Andrew Schwartzmeyer 9ba6ba359d Re-enable assembly name comparison 2016-07-26 11:54:08 -07:00
Andrew Schwartzmeyer b400ba3688 Use CORECLR to guard analysis progress record 2016-07-26 11:53:53 -07:00
Andrew Schwartzmeyer f0e64c2c6c Clean up ApplicationBase work-around 2016-07-26 11:49:54 -07:00
Andrew Schwartzmeyer d40131ae44 Clean up PSMODULEPATH Windows work-around 2016-07-26 11:49:54 -07:00
Andrew Schwartzmeyer cf8ddc10d6 Remove deprecated guard of resource verification 2016-07-26 11:49:54 -07:00
Jason Shirk (POWERSHELL) 673dd2c355 Change preprocessor macro LINUX to UNIX 2016-07-22 10:49:45 -07:00
Manikyam Bavandla MSFT 042d1e99bb Merge pull request #1458 from PowerShell/psedition_rename
Rename Desktop & Core PSEditions to WindowsPowerShell & PowerShellCore
2016-07-21 15:29:00 -07:00
Lee Holmes 105bf9c9ff Merge pull request #1452 from PowerShell/vors/remove-links
Remove unusable links from the source code
2016-07-21 13:12:28 -07:00
Andy Schwartzmeyer 6259c4a4c0 Merge pull request #1462 from PowerShell/johnkord-MMI_full_version
Setting MMI dependency in SMA to full version instead of wildcard
2016-07-21 12:16:01 -07:00
John Kordich 6ce8523ad9 Setting MMI dependency in SMA to full version instead of wildcard 2016-07-21 10:41:38 -07:00
Andrew Schwartzmeyer 8eda0df29e Remove CommandLineParameterBinderNativeMethods
This was dead code. PreParseCommandLine was called only when tracing was
enabled, which meant that the tracing itself was useless, as it was not
tracing what the actual code was doing.

I believe the intention of this tracing was to "guess" how the native
commands on Windows *might* parse their command-line arguments, but the
traced result was not guaranteed to be accurate. Since we cannot provide
accurate tracing, the tracer was removed in its entirety.

The PreParseCommandLine function was the only place where
CommandLineToArgv was called, so with it removed, the entire native
methods class here can be removed.
2016-07-21 10:39:16 -07:00
Andrew Schwartzmeyer c9c3e0b9be Remove managed CommandLineToArgv
It is entirely unused.
2016-07-21 10:39:16 -07:00
Manikyam Bavandla 81e5a7e7aa Update PSEdition values to Rename Desktop & Core to WindowsPowerShell and PowerShellCore
$PSVersionTable.PSEdition currently supports Desktop and Core enums.
Because PowerShell is going to be Open and also available on Linux/Mac
from August, we decided to rename these values so as to make it clear to
the end user.
We decided to use the names WindowsPowerShell,PowerShellCore.
2016-07-20 18:30:21 -07:00
Sergei Vorobev 20c4172754 Remove unusable links from the source code 2016-07-20 16:55:00 -07:00
Andrew Schwartzmeyer 0f04de1e96 Fix some documentation warnings
Mostly low-hanging fruit and Linux additions/changes.
2016-07-18 19:08:28 -07:00
Andrew Schwartzmeyer 790a07222e Disable some XML documentation warnings
Some projects have more warnings than I can fix.
2016-07-18 19:07:32 -07:00
Andrew Schwartzmeyer b6f26ad7cc Enable XML documentation generation
This is enabled for PowerShell projects, but not PackageManagment,
WSMan, Cim, or MMI.
2016-07-18 18:40:42 -07:00
Andrew Schwartzmeyer 70aa6af960 Remove unnecessary indirection from Platform.Unix 2016-07-14 17:34:12 -07:00
Andrew Schwartzmeyer 35e24ce6d4 Clean up CreateSymLink() 2016-07-14 17:34:12 -07:00
Andrew Schwartzmeyer ad94ddb3f1 Guard IsWinPEHost 2016-07-14 17:34:12 -07:00
Andrew Schwartzmeyer 89508ae99d Revert IsWinPEHost changes 2016-07-14 17:34:12 -07:00