Commit graph

6128 commits

Author SHA1 Message Date
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
Steve Lee 876085c6f0 Stop 'ConvertTo-Json' when 'Ctrl+c' is hit (#6392) 2018-03-19 09:13:05 -07:00
Andrew Palmer be109922f3 Change 6.0.1 references to 6.0.2 for 'linux.md' (#6411) 2018-03-16 21:06:00 -07:00
Travis Plunk 260aa49c4f
fix secret and JavaScript compliance issues (#6408)
fix secret and JavaScript compliance issues
- mark secrets as a test only secrets
- make javascript use strict in a specific function
2018-03-16 18:05:32 -07:00
kwkam 8ef5d4b8ee Make Resolve-Path -Relative return useful path when $PWD and -Path is on different drive (#5740)
* commands: make rvpa -relative do not return ./absolute_path

This happens on Windows when $pwd and -path is on different drive

* only return relative path inside current root
2018-03-16 15:06:37 -07:00
Steve Lee 263c98858b Update to Governance doc to reflect current working model (#6323)
With some changes in the PowerShell Team, need to update Governance doc to reflect current working model being used
2018-03-16 15:04:32 -07:00
Steve Lee 4d0f8cc0f5 Add Waiting - DotNetCore label (#6406)
Also, organize labels in alphabetical order.
2018-03-16 14:36:59 -07:00
Ilya a281853fcb Correct the '%c', '%l', '%k', '%s' and '%j' formats in 'Get-Date -UFormat' (#4805) 2018-03-16 09:44:42 -07:00
kwkam 5f202d676f Add 'NullReference' checks to two code paths related to 'PseudoParameterBinder' (#5738)
1. Add a null check in the tab completion code on the binding result returned from `PseudoParameterBinder`;
2. Add a null check in `CommandDiscovery.LookupCommandProcessor` on the `CommandInfo` object returned from the method `LookupCommandInfo`.
2018-03-16 09:10:06 -07:00
Amaan Marfatia 80d5df55c2 Standard deviation implementation on Measure-Object (#6238)
Implement iterative standard deviation algorithm for Measure-Object
2018-03-15 20:45:59 -07:00
Travis Plunk 339e4533e7
Add configuration for https://github.com/probot/stale (#6393)
* Add yml for https://github.com/probot/stale
2018-03-15 18:44:08 -07:00
Dongbo Wang 294def7b11
Fix 'PropertyOnlyAdapter' to allow calling base methods (#6394)
For a PropertyOnlyAdapter, the property may come from various sources, but methods, including parameterized properties, still come from DotNetAdapter. So, the binder can optimize on method calls for objects that map to a custom PropertyOnlyAdapter.
2018-03-15 15:09:38 -07:00
Travis Plunk a099786cdc
Update to DotNet 2.0.6 (#6403)
Update to DotNet 2.0.6
  - this addresses [Microsoft Security Advisory CVE-2018-0875: Hash Collision can cause Denial of Service](https://github.com/PowerShell/Announcements/issues/4)
  - This is a port of d607f207b9 to 6.1
2018-03-15 14:54:00 -07:00
Travis Plunk fcd6ddcfc7
Update version numbers to 6.0.2 (#6402)
* Add script to update the version number
* Update version to 6.0.2
2018-03-15 11:41:01 -07:00
Aditya Patwardhan 71cb49a99d Build: Remov version forcing code from NuGet package generation (#6390) 2018-03-15 10:12:56 -07:00
Klaudia Algiz 090f8761e8 Use new Pester syntax: -Parameter for Pester tests in engine. (#6298)
* Use new Pester syntax: -Parameter for Pester tests in engine.
2018-03-14 12:13:32 -07:00
Jason Shirk bd258a3dbc
Update CODEOWNERS 2018-03-14 10:04:56 -07:00
Dongbo Wang 7721042fd5 Pass the 'Match' object to $_ for the substitute script block in '-replace' operation (#6029) 2018-03-14 09:43:57 -07:00
Mathias R. Jessen 915639a177 Add lambda support to -replace operator
Add support for replacement lambdas when using the -replace operator.
Requires minimal changes to existing code by using the following overload:
    Regex.Replace(string input, MatchEvaluator evaluator)
when a ScriptBlock is passed in as the replacement argument.
2018-03-14 09:43:57 -07:00
Travis Plunk 8ffc0b0e3c
Support non-GitHub commits in the change log generation script (#6389) 2018-03-13 17:13:56 -07:00
Travis Plunk 8ba6f319f3
MSI: update architecture specific filenames (#6379) 2018-03-13 14:02:12 -07:00