Commit graph

5948 commits

Author SHA1 Message Date
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
Klaudia Algiz eeb03c89e6 Update tests in Modules/Microsoft.PowerShell.Diagnostics to use new Pester syntax. (#6351) 2018-03-23 10:33:43 -07:00
Klaudia Algiz dfa11d7f5e Add '-AsArray' parameter to 'ConvertoTo-Json' command (#6438)
Add `-AsArray` parameter to `ConvertoTo-Json` command to always pack the output string in array brackets, even if the input is a single object.
2018-03-23 10:32:13 -07:00
Klaudia Algiz cc3ffd8349 Use new Pester syntax: -Parameter for Pester tests in modules: Microsoft.PowerShell.Utility and Microsoft.WSMan.Management. (#6366) 2018-03-23 10:26:23 -07:00
Aditya Patwardhan e77213f413 Merged PR 1919: Fix release packaging build (#6459)
Fix release packaging build (#6459)

The release packaging build needs to have 'dotnet' in path, fixed that by adding Find-DotNet
Refactored restore logic so it can be used from both Start-PSBuild and Copy-PSGalleryModules
2018-03-22 18:50:51 +00:00
Aditya Patwardhan 60911df907 Fix release packaging build (#6459)
The release packaging build needs to have 'dotnet' in path, fixed that by adding Find-DotNet
Refactored restore logic so it can be used from both Start-PSBuild and Copy-PSGalleryModules
2018-03-22 11:37:54 -07:00
Aditya Patwardhan 942832c13a
Fix release packaging build (#6459)
The release packaging build needs to have 'dotnet' in path, fixed that by adding Find-DotNet
Refactored restore logic so it can be used from both Start-PSBuild and Copy-PSGalleryModules
2018-03-22 11:22:16 -07:00
Dongbo Wang 18d0a0bcbd
Use 'Unregister-Event' to remove an event subscriber when removing 'PSEdit' function (#6449) 2018-03-21 17:55:21 -07:00
Travis Plunk e5046baf9d Restore for official Linux arm builds (#6455) 2018-03-21 15:15:18 -07:00
Travis Plunk 8d2dd2ce30
Restore for official Linux arm builds (#6455) 2018-03-21 15:14:09 -07:00
Dongbo Wang c33e1ff828
Make '-CI' not depend on '-PSModuleRestore' in 'Start-PSBuild' (#6450) 2018-03-21 14:24:44 -07:00
Dongbo Wang 9df8ea58e9
Throw better parsing error when statements should be put in named block (#6434) 2018-03-21 14:24:20 -07:00
Travis Plunk 41b3161830
Fix error in windows provider when the environment as an existing set of variables name that only differs by case (#6320)
- make the provider storage for the environment on windows ignore duplicates
- add tests to verify existing environment get-item behavior
2018-03-21 12:30:49 -07:00
Travis Plunk 1730d8c496
MSI: update path with proper value (#6441)
MSI: update path with proper value
- Add verification that path is updated
2018-03-21 12:23:24 -07:00
Klaudia Algiz ceef2e37e9 Use new Pester syntax: -Parameter for Pester tests in Language. (#6304) 2018-03-21 10:47:08 -07:00
rjmholt cdc2015418 Change Get-FileHash tests to use raw bytes (#6430)
* Change filehash tests to use raw bytes

* Remove testablescript.ps1 from Get-FileHash tests

* Use BOM-less UTF8 input for Get-FileHash
2018-03-20 15:11:37 -07:00
kasper3 271dd50df2 Add Alpine Linux support (#6367)
sys/sysctl header is not available in musl-libc based systems and system calls are available without any header inclusion. I have ported the cmake test from CoreFX repo (https://github.com/dotnet/corefx/blob/431475b8/src/Native/Unix/configure.cmake#L560).

Progress towards: #4605
2018-03-20 13:34:18 -07:00
Dongbo Wang 1b3c8aca50
Fix the NullRefException when using '-PipelineVariable' with 'DynamicParam' block (#6433) 2018-03-20 12:02:46 -07:00
Travis Plunk f7c2b7def1
MSI: remove the version from the product name (#6415)
MSI: remove the version from the product name

During patching the original MSI information is displayed.
This makes installing a patch for an MSI with a specific version very confusing.
2018-03-20 10:49:01 -07:00
Travis Plunk 5e1bb01cb3
migrate the mac offical binary build to VSTS mac hosted preview (#6363)
create a PowerShellPackage...ps1 that works with these VMs (vs our custom VM)
create a script to create the \powershell folder with correct permissions
a YML VSTS build definition
2018-03-19 15:56:43 -07:00
Travis Plunk ae636df526
remove runas.exe from tests as we have tags to control this behavior (#6432)
remove runas.exe from tests as we have tags to control this behavior
- this should reduce the likelihood of errors
2018-03-19 15:36:56 -07:00
Dongbo Wang b49fb7f1b3
Update 'macos.md' and 'windows.md' with the version number '6.0.2' (#6416) 2018-03-19 11:38:27 -07:00
Dongbo Wang d0d4e3cf0c
Update the 'ChangeLog.md' for 6.0.2 release (#6417) 2018-03-19 11:37:27 -07:00