Commit graph

6567 commits

Author SHA1 Message Date
Dongbo Wang
79234ca91a Update version of modules shipped with PowerShell (#7531) 2018-08-15 15:25:08 -07:00
Travis Plunk
a0c6915eb5
Remove module version directories (#7523)
I missed this in reviewing #7518
2018-08-14 18:10:21 -07:00
Paul Higinbotham
a21366710c Updated thread job to version 1.1.2 (#7522)
Added fix to remove unneeded validation attribute for Arguments parameter, and made tests work with strict mode.
2018-08-14 17:09:48 -07:00
Travis Plunk
965552873c
Add Linux VSTS CI (#7527)
Update Start-PSPester and Start-PSxUnit to upload test results when running in VSTS
Disable tests which require non-root using when running as root
remove verifications in Test-Connection tests which verify buggy behavior
Skip tests which don't behave correctly in VSTS (due to running in a container?)
- Test-Connection - #7528
- Set-Date - #7529
2018-08-14 16:23:50 -07:00
Aditya Patwardhan
f19c5dae1f Update NuGet package metadata (#7517) 2018-08-14 13:31:58 -07:00
Aditya Patwardhan
ee33db0798 Fix building on RedHat Enterprise Linux (#7489)
When trying to build on RHEL, the environment is not recognized as RedHatFamily.
Added detection logic so that appropriate symbolic links are generated.
2018-08-14 13:21:26 -07:00
kwkam
820286e117 Build: Also search PATH for rcedit (#7503) 2018-08-14 10:17:29 -07:00
Steve Lee
769b02ab98 Save modules to un-versioned folder to enable servicing (#7518)
Remove code from build.psm1 that save the modules to a versioned folder. For servicing reasons after release it is preferred and easier to not have the versioned folder so that we can directly replace modules that need to be serviced (MSI specifically makes it difficult to service a module if the folder path changes).
2018-08-14 10:15:05 -07:00
Ilya
4ee1973d97 Fix some style issues in engine code (#7246)
The PR resolves some style issues in engine code. (Moved from PR #7242. )
2018-08-13 17:03:27 -07:00
Travis Plunk
b5acb298a4
workaround xunit test crash on VSTS (#7516) 2018-08-13 16:18:49 -07:00
Travis Plunk
b06b0ca6e5
Allow publishing artifacts or test results to fail but to fail the run (#7515) 2018-08-13 15:44:33 -07:00
Aditya Patwardhan
b149e55e47
Update README and metadata.json for release v6.0.4 (#7497) 2018-08-10 15:40:13 -07:00
Travis Plunk
b3d0913d74
Add CI definition for VSTS for macOS (#7490)
Add CI definition for VSTS for macOS
  - Add VSTS YAML for mac
  - Add a function to upload log files during a test on VSTS
2018-08-10 15:13:31 -07:00
Staffan Gustafsson
1243891ea8 Improve performance on json to psobject conversion (#7482)
This amounts so a speed-up in the order of 7x. Cmdlets that benefit from this are `Convertfrom-Json` and `Invoke-RestMethod`. There are three main changes:

- Convert from `JArray` directly to object array instead of creating a `List` and do `list.ToArray()`.
- Avoid iterating through `PSObject.Properties` to check for existing members, since that is a very slow and allocation heavy code path.
- Pre-allocate the members in `PSObject` by using the newly added constructor accepting an initial member count.
2018-08-10 10:28:15 -07:00
Staffan Gustafsson
3aaa1816d1 Adding 'LanguagePrimitives.TryCompare' to provide faster comparisons (#7438) 2018-08-10 10:20:27 -07:00
Brandon Olin
8374a5c97d Remove one unneeded verbose output from 'ConvertTo-Json' (#7487) 2018-08-10 10:13:05 -07:00
Syed Faraaz Ahmad
b754cd80d5 Throw error on entering non-existing type in Get-FormatData (#7434)
Write non-terminating error when `Get-FormatData` doesn't found a type definition for the provided type,
2018-08-10 09:34:02 +05:00
Staffan Gustafsson
037e12eddc Improve the performance of 'Group-Object' (#7410) 2018-08-09 12:11:06 -07:00
Staffan Gustafsson
618d9f31a0 Add '-SkipIndex' parameter to 'Select-Object' (#7483) 2018-08-09 11:59:54 -07:00
Dongbo Wang
791159d615
Add 'Former Repository Maintainers' section in maintainers/README.md (#7475) 2018-08-08 12:38:45 -07:00
Dongbo Wang
ca64bfb3e3
Update the 'HelpUri' for 'Get-ExperimentalFeature' (#7466) 2018-08-08 12:38:07 -07:00
Travis Plunk
d29349bb4d
Default to DefaultConsoleWidth when DotNet says WindowWidth is 0 (#7465)
Default to DefaultConsoleWidth when DotNet says WindowWidth is 0

This resolves an issue in an environment like VSTS when pwsh is spawned and DotNet is not able to determine the Console Width.
* Port changes from #6883 by @kalgiz
2018-08-07 15:27:42 -07:00
Travis Plunk
1523c218a6
Make sure that SettingFile arg is parsed before we load the settings (#7449)
Make sure that SettingFile arg is parsed before we load the settings

- Add ability to parse some setting before console host is created
- Trigger the Parse before the console host is created
- disable snapin loading from loading setting before this point
- re-enable mac logging tests.

Also, fix the following Travis-ci issues:

- make sure the Linux and macOS caches are separate to reduce the size
- update the macOS image to the closest image as used by the official build system (equivalent to VSTS hosted mac builds)
2018-08-07 15:01:31 -07:00
Bruce Payette
0c11582e6c Make Native globbing on UNIX return an absolute path when it is given an absolute path (#7106)
Fix #7089. Native globbing on UNIX was turning absolute paths into relative paths when it shouldn't. The code suppresses generating a relative path for paths starting with '~'. It also need to do the same for paths starting with '/'.
2018-08-07 14:38:22 -07:00
Aditya Patwardhan
f858e6d207 Add Microsoft.PowerShell.MarkdownRender to signing xml (#7472) 2018-08-07 11:47:36 -07:00
Steve Lee
36dc96af0e Fix error message for Add-Type when -AssemblyName with wildcard is not found (#7444) 2018-08-06 11:12:39 -07:00
Ilya
097e14426f Avoid extra unnecessary allocations in PSMemberInfoInternalCollection<T> (#7435)
`PSMemberInfoInternalCollection<T>` uses OrderedDictionary class internally. `OrderedDictionary` in dotnet core 2.1 allocates `ArrayList` and `Hashtable` after any first using any property. Even if the `OrderedDictionary` object is actually empty.

The commit postpones the internal allocations until it's really necessary. Given that `PSMemberInfoInternalCollection<T>` is used in each PSObject and is often empty, this change dramatically reduces memory allocations.
2018-08-06 11:06:37 -07:00
Staffan Gustafsson
d620c4fd1e Improve performance of Import-CSV up to 10 times (#7413)
Speed up the creation of PSObjects in CSV cmdlets by

- Use the overload Add(PSMember, bool prevalidated) for all objects except the first when adding the `NoteProperty` members.
- Add a new constructor to PSObject that preallocates the `_instanceMembers` collection with an initial capacity.
- Improve performance of AddToTypesXmlCache by avoiding an expensive copying of members just to check for the existence of one of them, perf is significantly increased, and allocations are reduced.
- Reduce allocations and GC pressure by preallocating and reusing `StringBuilders` and `List<string>` for line parsing in CSV cmdlets.
- Use `List<string>` instead of `Collection<string>` to get fewer virtual calls and better inlining.
- Reduce allocations by using a preallocated value factory in `TypeTable.GetMembers(ConsolidatedString types)`.
- Replace a `Linq.Any()` with a `List.Count > 0` in binder code.

The main gain is from taking advantage of the fact that all objects created by `Import-Csv` have the same shape (the same properties).
2018-08-06 10:58:55 -07:00
Greg Zimmerman
f0ea0d380f Add preview icon to macOS launcher (#7448) 2018-08-05 11:00:39 -07:00
kwkam
fbfbb4f005 [Feature] Fix Move-Item -Path with wildcard char (#7397)
Unescape non-literal, non-glob path in ProccessRecord and
set the context.SuppressWildcardExpansion in RenameItem.
This solve the issue where Rename-Item complains -Path does not exist
when both -Path and CWD contains special characters.
2018-08-05 17:31:06 +05:00
Robert Holt
dbdcf6e5eb Fix to not duplicate the System32 module path when starting pwsh from pwsh (#7414) 2018-08-03 11:22:30 -07:00
Dongbo Wang
25c127c3bc
Update CI scripts to support running tests for experimental features (#7419) 2018-08-03 11:20:14 -07:00
Aditya Patwardhan
ac8ac4f25b Update NuGet packaging code for the new markdown assembly (#7431) 2018-08-02 23:00:54 -07:00
Staffan Gustafsson
81313743df Improving performance of LanguagePrimitives.TryConvertTo. (#7418)
Before the fix the TryConvertTo() is implemented in terms of Convert(), but with wrapping exception handling. This is costly performance wise. By inlining the implementation of ConvertTo(), and getting access to the FigureConversion output we can determine upfront on at least some occations that a conversion is not available.
2018-08-03 09:18:05 +05:00
Steve Lee
f8b3abaac7 Add support for passing files and markdown directly to Show-Markdown (#7354)
* add support for -Path/-LiteralPath and piping strings directly to Show-Markdown

* update tests to set vt100 support
2018-08-02 15:49:38 -07:00
Christoph Bergmeister [MVP]
5717a5dffc Add xunit project to PowerShell.sln and make it runable from within VisualStudio (#7254)
* add csproj ref to sln

* Remove Microsoft.NET.Test.Sdk NuGet reference. The xunit.runner.visualstudio package is now sufficient for running tests in VS in the latest version (15.7.5)

* use RTM versions of XUnit 2.4.0 that got published today

* Update XUnit in hosting project as well to newer release
2018-08-02 11:51:04 -07:00
Dongbo Wang
73b6d810bd
Make logging tests for macOS pending (#7433) 2018-08-01 16:49:39 -07:00
Jianyun
344878dcbb Set the cursor to the place where a user hits tab key (#7299)
* Set the cursor to the place where a user hits tab key
2018-08-01 13:31:49 -07:00
Ilya
5d03e1653a
Remove empty xml comment lines (#7401) 2018-08-01 10:39:13 +05:00
Sergey Vasin
740d059d51 Change parameters order in Get-Help and help in order to get first -Full and then -Functionality when using Get-Help -Fu<tab> and help -Fu<tab>. (#7370) 2018-07-31 11:13:18 +05:00
Christoph Bergmeister [MVP]
779957b12a Update WCF and NJsonSchema NuGet packages to latest released patch version (#7411) 2018-07-31 09:53:38 +05:00
Sergey Vasin
58ac08c60a Use -HaveCount instead of -Be in Where-Object.Tests.ps1. (#7379) 2018-07-31 08:51:42 +05:00
Sergey Vasin
fcc519bb08 Fix parameter name in the Get-Variable cmdlet error message. (#7384)
Before the fix when using Get-Variable or Get-Alias cmdlets with the -Scope parameter with wrong value, the error message refers to 'scopeID' parameter instead of 'Scope'.
2018-07-31 08:50:41 +05:00
Aleksandar Nikolić
ca7f103a15 Fix casing of GitHub in best-practice.md (#7392)
Fix Github to GitHub.
2018-07-30 10:36:41 -07:00
Sergey Vasin
da6d2647ac Use -BeExactly and -HaveCount instead of -Be in TabCompletion.Tests.ps1. (#7380) 2018-07-30 10:32:52 +05:00
Sergey Vasin
9e30419501 Use -BeExactly and -HaveCount instead of -Be in BugFix.Tests.ps1. (#7386) 2018-07-30 08:17:28 +05:00
Aleksandar Nikolić
27df6dcb32 Fix a typo in issue-management.md (#7393) 2018-07-27 17:44:59 -07:00
Aleksandar Nikolić
a5f9b50319 Fix typos in docs/maintainers/README.md (#7390) 2018-07-27 17:29:07 -07:00
Aditya Patwardhan
4e7c2ed663 Fix several issues in Markdown cmdlets (#7329)
- Formatting file should be used for `MarkdownOptionInfo` object instead of the types file for adding script property.
- Downlevel windows consoles which do not support VT100 escape sequences should be handled gracefully.
- Add helpuri fwlink for cmdlets.
- Make `-Path` a positional parameter for `ConvertFrom-Markdown`
- make `-InputObject` a positional parameter for `Set-MarkdownOption`
2018-07-27 17:26:35 -07:00
Dan Thompson
e7c315b65c Start-DevPowerShell: add -Configuration and handle -ArgumentList more properly (#7300)
- Allow specifying the configuration, rather than the `bin` folder.
- Do not attempt to pass null/empty `ArgumentList` to `Start-Process`.
2018-07-26 10:30:05 -07:00