Commit graph

6020 commits

Author SHA1 Message Date
Darwin 46fa2260a8 Update installpsh-<distrofamily>.sh Installers to Handle "preview" in version number (#6573) 2018-04-06 15:23:11 -07:00
Steve Lee 38c53c50a6 Support 'user@host:port' syntax for SSH Transport (#6558) 2018-04-06 15:04:37 -07:00
Sergey Vasin 4554679a08 Use -Throw and -ErrorId native Pester parameters. (#6574) 2018-04-06 16:15:37 +04:00
Ilya 31085d5737 Use C# latest language in proj files (#6559)
Address #6547

We begin using C# 7.2 features (Span) but .Net Core doesn't seem use "Latest" as default for a language.
So we explicitly set the value.
2018-04-05 17:39:20 -07:00
Dongbo Wang 2a45b48ae2
Remove the FullCLR-only symbol-info related code from 'EventManager.cs' (#6563)
This is because the `AssemblyBuilder` family types do not support emitting symbol information in .NET Core.
2018-04-05 13:57:05 -07:00
Dongbo Wang 6584447025
Engine: Fix several code cleanup issues (#6552) 2018-04-04 14:47:44 -07:00
Dongbo Wang e0b1f1f3af
Fix line ending in 'DefaultCommands.Tests.ps1' from CRLF to LF (#6553) 2018-04-03 13:32:16 -07:00
Dongbo Wang ceac82abc5
Fix running 'pwsh' produced from 'dotnet build' (#6549) 2018-04-03 12:06:14 -07:00
Ilya 24cf020442 Add ported Test-Connection cmdlet (#5328)
The Test-Connection cmdlet works on Windows and Unix.

Implemented:
Ping
Continues Ping
Traceroute
Detect MTU size (seems don't work on Unix because of .Net Core issue)
Connect to TCP port
Not jet implemented:
I'm putting this off for the future.

Detect blackhole routers
PingPath
Additional considerations
As you can see in the tests .Net Core has issues in API implementation. As a result, some tests are skipped on Unix. There is also one issue on Windows. Related comments added to tests.
I'm going to open an issue(s) in CoreFX repo.

I think we should break the feedback into two parts:

scripting functionality
interactive functionality (display output)
Now I have implemented the output to the screen as the progress bar and as text (without ETS) - we have to decide what is best to use.
2018-04-03 11:59:26 -07:00
Travis Plunk a267ca5216
Merge - Get the VisualStudio solution working (#6546)
Changing the project type GUID. This should make the TargetFramework not required to
build in Visual Studio for Windows (works on Mac without the change.)
Add the powershell-unix project so you can choose which one to build.
remove a resource that wasn't used and fails in VS from two resource files.
2018-04-03 11:32:10 -07:00
Takuya Shibata cd1d2d2063 Fix error when 'Format-Wide -AutoSize | Out-String' is called. (#6491)
* Add checking if an output width is specified.

* change _failedToReadConsoleWidth variable to _noConsole bool value. 
This variable is to cache the default console width when failed to get 'Console.WindowWidth' value.
2018-04-03 11:17:05 -07:00
Klaudia Algiz f0b6ef2eb4 Terminate the loop in PsUtils.GetMainModule() which was infinite in case there was no main module. (#6358)
* Terminate the loop in GetMainModule if main module is null.

* Run tests with FileVersionInfo also on non-windows platforms. Add test for process which main module can be null.
2018-04-03 10:58:06 -07:00
Travis Plunk 9b6c9af92a rename solution to powershell 2018-04-03 09:50:09 -07:00
Travis Plunk 78f797a3b8 Add comments about configuration mappings 2018-04-03 09:44:53 -07:00
Travis Plunk b3860452a2 add mappings for unix project 2018-04-03 09:36:46 -07:00
Travis Plunk 4ce9506d32 change project type for unix project 2018-04-03 09:35:10 -07:00
Travis Plunk 4e2089e5d9 add comment about project guids 2018-04-03 09:34:36 -07:00
Steve Lee 5d3456d11b Fix formatting of tables where headers span multiple rows (#6504)
* In cases where the header spans multiple rows, need to correctly calculate whitespace and trim appropriately

* Use System.Span<int> and C# 7.2 language in SMA

* Added new ref assemblies to Files.wxs
refactor tests to remove similar xml content
added single column test case
2018-04-03 07:24:23 +04:00
Travis Plunk 3547357b25 Map configurations to correct configurations
This reverts commit 9cbf601576.
2018-04-02 19:08:44 -07:00
Travis Plunk b63045c617 Add Unix project to sln 2018-04-02 18:22:37 -07:00
Staffan Gustafsson b1743dca01 Removing invalid resources to make Visual Studio builds compile. 2018-04-02 18:22:37 -07:00
Staffan Gustafsson 9cbf601576 Updating solution file with new project type guids 2018-04-02 18:22:37 -07:00
Dongbo Wang d1cf82ec20 Clean up workflow logic in the module loading component (#6523)
Clean up workflow logic in the module loading component.
Workflow module is not supported in PSCore.
Currently, Import-Module throws a terminating error when seeing .xaml modules. After the change, Import-Module throws a non-terminating error when seeing .xaml modules.
2018-04-02 16:18:56 -07:00
Aditya Patwardhan 610ae1a63f Update 'Update-Help' to save help content in user scope by default (#6352)
Add the parameter `-Scope` to `Update-Help`, which takes `AllUsers` or `CurrentUser`. The default value is `CurrentUser`.
2018-04-02 15:32:55 -07:00
Aditya Patwardhan 260c16ff4f
Mark Save-Help PackageManagement tests as pending (#6545) 2018-04-02 14:07:02 -07:00
Dongbo Wang 9e3ffb10e5
Remove duplicate 'Restore-PSPackage' (#6544) 2018-04-02 13:38:49 -07:00
Travis Plunk 77f36498e6
Simplify the paths the MSI uses (#6442)
- Implementation of PowerShell/PowerShell-RFC#115 (If anything changes in the RFC, we will treat it as a bug, and fix it later)
- Update registry and directory paths to use 6 for the version for stable and 6-preview for a preview release
- Add checkbox to set path
- default checkbox to off for preview builds and on for stable builds
2018-04-02 10:47:29 -07:00
Kevin Marquette 986a9eeecd Remove empty Should -Be statements (#6536) 2018-04-01 15:05:45 +04:00
Kevin Marquette e3ba6bd92c Fixed scenarios where NullOrEmpty string was used instead of -BeNullOrEmpty (#6535) 2018-04-01 15:05:08 +04:00
Kevin Marquette 404e876740 Use new Pester syntax: -Parameter for Pester tests in modules: PowerShellGet, PackageManagement, PSReadLine (#6488) 2018-03-30 09:22:26 +04:00
Dongbo Wang cd075ea4b4 Make LanguagePrimitive.GetEnumerable treat 'DataTable' as Enumerable (#6511)
* Make LanguagePrimitive.GetEnumerable treat 'DataTable' as Enumerable
2018-03-29 16:22:44 -07:00
Dan Travison ec0f1116db Add PowerShell logging tests for macOS and Linux (#6025)
This PR fixes the logging issue on Linux where logging is initialized before `-settingsFile` is parsed causing custom log settings to be ignored. (see ConsoleHost.cs and ManagedEntrance.cs)

The PR also includes basic logging tests for Linux and MacOS. PSSyslog.psm1 contains the functions to retrieve selected logged items (based on PowerShell's log id and a timestamp) and Logging.Tests.ps1 contains tests for Linux and MacOS.
2018-03-29 14:46:08 -07:00
Kevin Marquette 5da5a4bf62 Use new Pester syntax: -Parameter for Pester in SDK and Provider tests (#6490) 2018-03-29 08:08:22 +04:00
rjmholt faa21c907b Change the 'SaveError' method in Parser to use nameof for error ids (#6498)
Many error messages in PowerShell currently use a LINQ expression to pass both the name of the error and the message through in the error processing. This PR uses the `nameof` feature to carry the error name/ID and gets rid of LINQ expression reflection, hopefully improving performance, especially in editor scenarios.
2018-03-28 16:21:25 -07:00
Steve Lee c18b9999d6 Enable [Environment]::OSVersion to return current OS rather than compatible version (#6457)
* add application manifest dictating compatibility so that osversion shows appropriate os version on Windows
2018-03-28 13:36:16 -07:00
James Truher [MSFT] a6479f8181 Make sure that the width of the header is at least the size of the label (or propertyname) (#6487) 2018-03-28 13:34:29 -07:00
Andrew 9a061457f4 Update Dockerfile test to use ubuntu 17.10 as the base image (#6503) 2018-03-28 09:32:54 -07:00
Michael Klement 87834d07b4 Fix error in windows provider when the environment has accidental duplicates that differ only by case (#6489)
Fix error in windows provider when the environment has accidental duplicates that differ only by case.

Make the provider storage for the environment on windows ignore duplicates
 and only report the effective value.
Add tests to verify existing environment get-item behavior and to ensure that Get-Item env:<var> reports the same as $env:<var>, namely the effective value.
Fixes #6305 and supersedes #6320 based on discussion in #6460.
2018-03-27 14:58:26 -07:00
M-D-M 7c7204a1ba Doc: Update Ubuntu source creation commands to use 'curl -o' (#6510)
Updated the Ubuntu source creation commands to remove the need for piping
2018-03-27 14:57:29 -07:00
Simon Wåhlin 31405f7283 Add the parameter '-Not' to 'Where-Object' (#6464) 2018-03-26 16:34:13 -07:00
Travis Plunk 701b919345
MSI: add function to generate a MSP (#6445)
add a function to generate an MSP
2018-03-26 14:39:48 -07:00
Aditya Patwardhan d301e62d3a
Merge pull request #6484 from PowerShell/release-v6.1.0-preview.1
Release v6.1.0 preview.1
2018-03-26 13:17:05 -07:00
Mark Kraus d20d53eaac Add -Resume Feature to Web Cmdlets (#6447)
Fixes #5964

Adds -Resume switch to Invoke-WebRequest and Invoke-RestMethod

-Resume requires -OutFile

Enables the ability to resume downloading a partially or incompletely downloaded file.

File Size is the only indicator of local and remote file parity.

If the local file is smaller than the remote file and the remote endpoint supports resume, the local file will be appended with the remaining bytes.

If the local file is larger than the remote file, the local file will be overwritten

If the remote server does not support resume, the local file will be overwritten

If the local file is the same size as the remote file, the remote endpoint will return a 416 status code. This response is special-cased as a success in this instance. The local file remains untouched and it is assumed the file was already successfully downloaded previously.

If the local file does not exist it will be created and the entire remote file will be requested.

Added tests for all code new code paths (I'm pretty sure anyway)

Added /Resume Controller to WebListener

Documented /Resume Controller

Updated .spelling to reflect terms in WebListener docs

Note: I had to change the way GetResponse() tracks the current URI as we now have 3 places where the call is taking place. I don't foresee this causing any regressions. This area needs some refactoring. especially if we want to implement a retry mechanism
2018-03-26 12:23:24 -07:00
Ilya 1b745f6a98 Add Test-Json cmdlet (NJsonSchema) (#5229)
Resolve #4220.

The cmdlet is based on NJsonSchema.
It allows to check:

JSON by only parsing
JSON against Schema
implicitly check Schema by parsing (based on previous line check)
NJsonSchema is under MIT (approved see https://github.com/PowerShell/PowerShell/pull/5229#issuecomment-342983215)
2018-03-26 11:52:48 -07:00
Ilya a29484051e Update stale bot message (#6462)
Fix #6446

Add "Community members are welcome to grab these works."
2018-03-26 11:09:03 -07:00
Aditya Patwardhan 9bc81ad695
Update docs for v6.1.0-preview.1 release (#6481)
* Update docs

* Added the missing 'stable' label
2018-03-23 16:48:24 -07:00
Dongbo Wang 965e49161d
Update change log for 6.1.0-preview.1 (#6480) 2018-03-23 16:04:08 -07:00
Christoph Bergmeister e86fea6acd Upgrade tests in test\powershell\Host folder to PesterV4 syntax (#6250) 2018-03-23 10:48:26 -07:00
Kevin Marquette acb52b3d9c Update tests in Microsoft.PowerShell.Security folder to use Pesterv4 syntax (#6256) 2018-03-23 10:41:14 -07:00
Klaudia Algiz ff2486416d Update tests in Modules/Microsoft.PowerShell.Core to use new Pester syntax. (#6349) 2018-03-23 10:36:11 -07:00