Commit graph

4856 commits

Author SHA1 Message Date
Michael Klement 30b97a5d7c Fix for #3786 (#3793)
The appropriate [SemanticVersion] constructor now accepts a [version] instance that has only major and minor components specified, in which case the patch component now defaults to 0.
2017-05-16 17:10:03 -07:00
Steve Lee 96506f4cc1 Cross-gen the top assemblies with JIT times > 5ms (#3787)
Startup went from 1998 ms to 1067 ms.
Size went from 103 MB to 133 MB.
2017-05-15 23:34:32 -07:00
jeffbi ee1a897f91 Prevent Get-ChildItem from recursing into symlinks (#3780)
Brings the Get-ChildItem more in line with the Unix ls -r and the Windows DIR /S native commands. Like these commands, the cmdlet will display symbolic links to directories found during recursion but will not recurse into them.
Like the Unix ls command---and unlike the Windows DIR /S command--- the cmdlet will recurse into symlinks given on the command line.
2017-05-15 14:09:46 -07:00
Dongbo Wang 2d06c17093 update the doc about hosting powershell with a sample that uses beta.1 packages (#3770) 2017-05-12 15:25:41 -07:00
Aditya Patwardhan 89638a814e Enable Get-TimeZone for Unix platforms since required classes are available in .Net Standard 2.0. (#3735) 2017-05-11 16:27:52 -07:00
Steve Lee 6775031656 Update README.md (#3757)
Need to update the privacy statement link to the broader one
2017-05-11 10:32:10 -07:00
Dongbo Wang 95f96bc50d Update releasing.md about NuGet package suffix (#3759) 2017-05-11 10:30:19 -07:00
Joey Aiello e43dcf4d23 Beta 1 known issues doc (#3583) 2017-05-10 15:52:19 -07:00
Travis Plunk c06caa95d2 Add locales package and only generate locale after adding package (#3756) 2017-05-10 12:47:22 -07:00
Dongbo Wang ee779b58e0 Update docs for beta.1 release (#3748)
* First iteration

* Second iteration

* Third iteration

* Fourth iteration

* Fifth iteration

* Revert the temporary workaround

* beta.1 release only support Mac OSX 10.12+
2017-05-10 09:49:02 -07:00
Andrew e70e410741 Installation docs update for Debian 8 and RHEL 7 (#3709)
* Debian8 update

* RHEL7 update

* Main page update

* Fixed 'MD024 Multiple headers with the same content'

* Update linux.md

Added explicit text about compatibility of Ubuntu14.04 pkg on Debian8 to avoid confusion about URLs

* Update linux.md
2017-05-09 13:18:01 -07:00
Dongbo Wang c8a9284731 Temporary workaround #2 to fix the PSVersion issue in beta.1 release (#3742) 2017-05-09 00:21:28 -07:00
Dongbo Wang 44c6409fdd Temporary workaround to fix the PSVersion issue in beta.1 release (#3740) 2017-05-08 22:52:30 -07:00
Dongbo Wang 74382288ca Update CHANGELOG.md for 'v6.0.0-beta.1' release (#3736) 2017-05-08 17:58:12 -07:00
Steve Lee 63429445f9 Relax SemanticVersion constructors to not require minor and patch (#3696)
`$psversiontable.psversion -gt "3.0"` which is used by PowerShellGet to determine if a module is compatible with the current version of PowerShell.

Change is to allow specifying only major or major+minor where the missing segments default to zero by providing overloaded constructors and allow
the string parsing method to not require major, minor, and patch segments to all be specified (only major is required).

Based on the [response](https://github.com/mojombo/semver/issues/368) from the maintainer of semver, there is no requirement to have strict
conformance for the inputs to the constructor and allowing "3.0" to result in a semver of 3.0.0 is reasonable.
2017-05-08 10:44:40 -07:00
Dmitrii Evdokimov 5938688d86 Fix a pipe char in the table formatting (#3714)
Set the proper escaping for a pipe char inside of a cell text in Markdown.
2017-05-07 22:38:07 -07:00
Staffan Gustafsson 8d744f2517 Use '<id> - <name>' as ToolTip and ListItemText when tab completing process ID (#3664) 2017-05-05 18:05:21 -07:00
Dongbo Wang 3175d25762 Update 'Build.sh' to allow building powershell manually on Unix (#3710) 2017-05-05 15:17:01 -07:00
jeffbi 938e13602b Change error message when using New-Item to create a symlink and the item exists (#3703) 2017-05-05 10:09:34 -07:00
Ilya d275cee214 Correct formatting in PSVersionInfo (#3694) 2017-05-05 09:21:27 -07:00
jeffbi 3e416fb642 Change Get-ChildItem to list the content of a link to a directory on Unix. (#3697)
Brings Get-ChildItem in line with ls command on Unix and with the PowerShell behavior on Windows when the link is a directory symbolic link.
2017-05-04 18:00:13 -07:00
Dongbo Wang 1b16f77e21 Update powershell to use .NET Core 2.0.0-preview1-002106-00 (#3699)
Use 2.0 CLI/SDK of version `2.0.0-preview1-005952` to keep in sync with the .NET Core 2.0 //Build dogfood instructions. The version of `Microsoft.NetCore.App` in use is `2.0.0-preview1-002106-00`.
2017-05-04 17:09:03 -07:00
Ilya 42cb8ba643 Move 'PSVersion' and 'PSEdition' to first and second places in $PSVersionTable (#3562) 2017-05-03 21:33:52 -07:00
James Truher [MSFT] 563806c15d Change native execution tests to use df instead of stty (#3685)
when automating test execution, some environments don't have a tty which causes
the tests to fail. df is just as good a test as stty as it is also guaranteed to be
present. This change also allows the tests to be run on OSX
2017-05-02 18:45:35 -07:00
jeffbi 2a739afa9c Fix Rename-Item to allow Unix globbing patterns in paths (#2799) (#3661)
* Fix Rename-Item to allow Unix globbing patterns in -Literal paths (#2799)

In the process of normalizing a relative path, PowerShell checks to see
see if the path exists, which it does by invoking
    Directory.EnumerateFiles(directory, filename);

On Unix platforms, if the filename contains globbing patterns, such as [ab],
EnumerateFiles (and EnumerateDirectories) will perform the globbing. Using
globbing patterns, a file named 'file[txt].txt' is reported as not existing.

This fix changes the file-existence test on Unix to use a native function
instead of either of the Directory.EnumerateXXX functions.

* Fix for AppVeyor failure

* Changes per code review, and a couple of letter-casing changes.
2017-05-02 18:42:16 -07:00
Steve Lee 0187d9e110 Add statement to README.md covering the current telemetry implementation (#3673)
Add statement regarding the current telemetry implementation to address concerns from Privacy Review
2017-05-02 18:27:42 -07:00
Jason Shirk dccce7e8a3 Update class grammar comments (#3688) 2017-05-02 15:36:20 -07:00
Sergei Vorobev c7e377891b Add updating homebrew instruction (#3533) 2017-05-02 15:34:12 -07:00
Mike Richmond 0f5e9f876e Add documentation about the Univeral C Runtime dependency (#3495) 2017-05-02 10:14:17 -07:00
Ilya 3d7ef43498 Improve ValidateCount attribute error message (#3656)
Leave only two message for ValidateCount attribute error:
1. Count is not in allowed range.
2. Count is not exactly equal allowed value.
2017-05-02 10:04:52 -07:00
Dongbo Wang 52336b8fda Diable schema validation in ScriptWriter.cs (#3679) 2017-05-02 09:40:53 -07:00
Dongbo Wang 73e5dc3020 Make sure nuget package version suffix applies to all ProjectReference (#3678) 2017-05-01 22:34:25 -07:00
Chunqing Chen 9051ca1fbc PSVersionTable should have entry for OS and Platform (#3654) 2017-05-01 21:04:49 -07:00
Chunqing Chen 5a82b10fc7 Get-Help should find help files under pshome (#3528) 2017-05-01 13:54:01 -07:00
Bruce Payette 11ad02a15a Adding support for native command globbing on UNIX (#3643)
This change enables globbing (wildcard expansion) against the file system for native commands like '/bin/ls'. The expansion is only done in the file system. In non-filesystem drives expansion is not done and the pattern is returned unchanged.

Limitations of the fix:
Currently quoting is not honored so for a command like /bin/ls "*.txt", wildcard expansion will still be done. Adding support for bare word detection will come in a future PR. Use --% to suppress wildcard expansion e.g. git add --% *
2017-05-01 12:23:36 -07:00
Andrew c0aafdb3d0 Fixing a bug related to ModuleSpec syntax in RequiredModules (#3594)
This fixes issue #2607.
'RequiredModules' is a field in module manifest that can reference other modules using ModuleSpecification format.
The basic version of this format (just module name) was working fine, however, there was a problem when a more detailed version of the format was used (the one that uses module versions or/and GUIDs).
During module import, there is a check for cyclic references through 'RequiredModules' field. The bug was in this check for cyclic references, related to comparison rules for ModuleSpecification objects - as a result, the code was incorrectly reporting 'cyclic reference' error in cases when there was none.
Also, added tests for different ModuleSpecification formats and a test for error when there is actually a cyclic reference.
2017-04-30 17:58:44 -07:00
Dongbo Wang 08e855556c Mark '-SkipCertificateCheck' tests pending on OSX for now (#3660)
Mark two tests pending on OSX due to #3648
2017-04-27 18:15:59 -07:00
jeffbi f1769fe7a8 Change behavior of Remove-Item on symbolic links (#621) (#3637)
When 'Remove-Item' is used to remove a symbolic link in Windows, only the link itself is removed. The '-Force' switch is no longer required.
If the directory pointed to by the link has child items, the cmdlet no longer prompts the user to remove the child items---those child items are not removed. The '-Recurse' switch, if given, is ignored.
This brings 'Remove-Item' more in line with the behavior of the 'rm' command on Unix.
2017-04-27 17:47:24 -07:00
James Truher [MSFT] a2268ab3ec Add telemetry to the console host to report platform and version (#3620)
This is limited to the console host and is not meant as generalized telemetry code for PowerShell Core. It will capture the GitCommitID and Platform Information when the console host starts. It enables opting out of sending telemetry.
2017-04-25 22:51:22 -07:00
Staffan Gustafsson f0eda031d6 Performance improvements to security checks when group policies are in effect for ExecutionPolicy (#2588)
* Caching the parent id of the current process
In certain scenarios, like a domain joined machine with an executionpolicy set via GPO, a lot of checks are done for the ExecutionPolicy, and this is in the hot path.

* Caching HasGPScriptParent.
It is expensive to determine if a script was run as a result of applying a group policy. This does not change during the lifetime of a process.
This only affect the scenario when an execution policy has been set by a group policy.

* Using available Microsoft.PowerShell.ProcessCodeMethods.GetParentPid
2017-04-25 18:07:54 -07:00
Lee Spottiswood 1d42862e21 Adds Port parameter for SSH PSSessions (#3499)
* fixes summary block typo

* Adds support for Port parameter for SSH PSSessions

* Reverted back to master, modified based on PR feedback

* Update exception message

* remove unused line

* Add existing constructor back in as to not break public contract

* remove port check

* pass nested inner exception straight to Should

* dispose runspace after each test

* Add SSHHostParameterSet attribute for Invoke-Command Port property

* Update ParseSSHConnectionHashTable method to accept Port value as integer

* Add helper method for validating port in range. Refactor port parameter constructor overload to use original constructor

* rename method

* Adds GetSSHConnectionStringParameter and GetSSHConnectionIntParameter methods for retrieving SSHConnection hashtable values

* Adds method comments

* Adds helper method comment

* Change methods to add C# 7 patterns
2017-04-25 18:02:16 -07:00
Steve Lee ee9049b61f New-ModuleManifest was incorrectly checking if a Uri was well formed by using ToString() which just outputs the original (#3631)
string.  If the string was a uri with spaces, ToString() doesn't return the escaped version.  The AbsoluteUri property
should be used instead which returns an escaped absolute uri (if valid).

Also renamed TestModuleManfest.ps1 to TestModuleManifest.Tests.ps1 so that it gets picked up correctly as Pester test.

Since HelpInfoUri is just a string, ensure it is a valid absolute uri and escaped correctly whereas before it was just
an opaque string that wasn't validated.
2017-04-25 17:45:24 -07:00
David Christian f8f603ada6 Added tests for Test Connection (#3604) 2017-04-25 09:53:17 -07:00
Staffan Gustafsson 5bdcff5ad9 Fix tab completion with '@{<tab>' to avoid crash in PSReadline (#3626) 2017-04-25 09:42:43 -07:00
Staffan Gustafsson f959c41e71 Add Hashtable tab completion for -Property of select-object (#3625)
Also added more tab completion tests.
2017-04-24 16:45:05 -07:00
Paul Higinbotham b5f10ecba2 Added requested comment (#3640) 2017-04-24 16:21:21 -07:00
Ilya 6db5c945b2 Remove unused and duplicated GetEncodingFromEnum (#3487) 2017-04-21 18:07:54 -07:00
Paul Higinbotham a16b71bad4 SSH Remoting should handle multi-line error messages from SSH client (#3612)
* Fix to support multi-line error messages from SSH client

* Fixed resx file

* Added null check

* Added Environment.NewLine
2017-04-21 18:01:11 -07:00
Ilya e8ec40069b Improve ValidateCount attribute error message (#3596) 2017-04-21 18:01:04 -07:00
James Truher [MSFT] 63c20f15b1 Add dockerfile and test so we can test simple remoting behaviors (#3470)
* Add dockerfile and test so we can test simple remoting behaviors

this docker file creates an image which can be used to test remoting with containers.
We start with the microsoft/windowsservercore image and then set up the system for
testing by adding a user, setting up configuration for basic auth, installing
PowerShell Core, and creating a configuration endpoint for PSCore.

The tests are very simple; it retrieve $PSVersionTable.PSVersion in the following
connections:
   Full -> Full
   Full -> Core
   Core -> Full
   Core -> Core

* Add new file to bootstrap the docker image

fix the tests to be more resilient to changes in the version of the PSCore package

* update script to use local user cmdlets rather than net.exe

also remove pscore.msi at the end of the image build process to save space

* clean up commented lines and remove an unused parameter from one of the functions

also use constants more consistently

* remove reference to docker image name by string and use variable instead.
2017-04-21 17:23:08 -07:00