Commit graph

6314 commits

Author SHA1 Message Date
Dongbo Wang d12230f188 [Feature] Address Feedback: Use value tuple (int, string) as the sorting key 2018-07-11 17:53:24 -07:00
Travis Plunk 79d20a1873
Update PowerShell Direct to try pwsh then fallback to powershell (#7241)
Update PowerShell Direct to try pwsh then fallback to powershell

  - Forward port changes from Windows Powershell to fall back
  - change the order from powershell->pwsh to pwsh->powershell

fixes #7237
2018-07-11 15:44:31 -07:00
Aditya Patwardhan 749d1609bb
Update README files for native code for migration (#7248) 2018-07-11 14:32:01 -07:00
Steve Lee e5e1c53084 Add test to verify filesystem provider isn't used when accessing root path in psdrive (#7173)
* add test to verify filesystem isn't used when not in filesystem drive
2018-07-11 14:10:29 -07:00
Paul Higinbotham 040c494f94 Fixes to address ThreadJob tests reliability and speed (#7270)
This change merges Jim's fixes with some more I identified that will make the tests more reliable and faster to run.

The changes add functions to wait for the desired state instead of simply waiting a specified period of time, and also speeds up running job script execution time.
2018-07-11 13:00:08 -07:00
Dongbo Wang add14e452f [Feature] Address Feedback: Do not override user defined cache path 2018-07-10 22:53:39 -07:00
Dongbo Wang 0ac878f72c [Feature] Address Feedback: Fix style and xml doc issues. Update tests 2018-07-10 12:46:48 -07:00
Dongbo Wang 2c9519ba3b [Feature] Address Feedback: Use better error message and add more tests 2018-07-10 02:14:59 -07:00
Dongbo Wang c7c35bdcf3 [Feature] Address Feedback: make value tuple element types explicit 2018-07-09 17:51:19 -07:00
Dongbo Wang b616cf578a [Feature] Address Feedback: style changes and fixing typo 2018-07-09 17:17:12 -07:00
Dongbo Wang 10334220e8 Address Feedback: functional changes and method/variable renaming 2018-07-09 17:14:34 -07:00
Dongbo Wang 2fce1bfe56 [Feature] Root caused test failure issue and fix it 2018-07-09 10:51:57 -07:00
Christoph Bergmeister [MVP] ef10460172 Make 'Start-PsBuild -Clean' not prompt due to locked files when Visual Studio is open by excluding sqlite3 folder and use -x instead of -X option on git clean (#7235)
* Exclude sqllite  folder when cleaning and use -x instead of -X option

* Remove 2nd git clean block which is redundant now
2018-07-09 10:16:56 -07:00
PRASOON KARUNAN V 9dcfddde9e Adding -AllStats Switch parameter for Measure-Object cmdlet (#7220) 2018-07-09 08:45:32 +05:00
Dongbo Wang bc8abf8efa [Feature] Fix two tests 2018-07-06 13:28:20 -07:00
Dongbo Wang d2e9151fff [Feature] Add tests for experimental feature work 2018-07-06 13:28:20 -07:00
Dongbo Wang 3c3ddeb127 Alter the analysis cache file name properly 2018-07-06 13:28:20 -07:00
Dongbo Wang d8d3344e98 Generate logging resources for Unix platforms 2018-07-06 13:28:20 -07:00
Dongbo Wang dc2d741791 Add logging, formatting, and '$EnabledExperimentalFeatures' 2018-07-06 13:28:19 -07:00
Dongbo Wang 7770aa547e Add 'Get-ExperimentalFeature' cmdlet 2018-07-06 13:28:19 -07:00
Dongbo Wang 8a5ddbb231 Support experimental feature in modules 2018-07-06 13:28:19 -07:00
Dongbo Wang 930350e2ee Update code that creates attributes to support the new attribute changes 2018-07-06 13:28:19 -07:00
Dongbo Wang eed9842534 First batch: Basic experimental feature flag and attributes enforced 2018-07-06 13:28:18 -07:00
Ilya b1a525923a
Remove dummy comments in Utility module files (#7224)
* Remove dummy comments (like } // dummy ) in Utility module files
* Fix new line at eof.
2018-07-06 13:50:13 +05:00
Meir Blachman 58e9b4969a Update docs for ArgumentCompleterAttribute class (#7227) 2018-07-06 08:34:45 +05:00
Paul Higinbotham a57fafedc6 Add ThreadJob module package and tests (#7169) 2018-07-05 17:38:12 -07:00
Dongbo Wang 73d71d9a9c
Build: Fix the source location of PowerShell.Core.Instrumentation.dll (#7226) 2018-07-03 18:05:57 -07:00
Christoph Bergmeister 56e50ce632 Update 'Start-PSPester' to make it more user friendly (#7210)
- Make `Start-PSPester` call `Restore-Pester` automatically when needed,
- Make `-Path` a positional parameter for `Start-PSPester`.
2018-07-03 11:16:37 -07:00
Alex Jordan 55bbc3fcd1 Fix the name of a 'Register-EngineEvent' test (#7222) 2018-07-03 10:41:15 -07:00
Robert Holt de41ca519c Refactor module specification logic (#7126)
* Use `nameof` where appropriate
* Factor out a repeated `entry.Key.ToString()` call
* Use a `StringBuilder` in the `ToString()` method
* Dissect a trick comparison method into something simpler
* Use HashCode.Combine() method
2018-07-03 11:18:12 +05:00
Staffan Gustafsson 3c079b9d42 Add type inference for Select-Object command (#7171)
Add type inference for Select-Object command

Fixes #7170
2018-07-02 13:23:30 -07:00
Bruce Payette dbaa1add3a Methods with return type [object] should return null for an empty result (#7138) 2018-07-02 12:58:42 -07:00
Steve Lee 06960346a1 Enable UseShellExecute on all platforms (#7198)
Previously, we limited use of UseShellExecute when starting a new process to only Windows Desktop.  However, CoreFx now supports UseShellExecute (appropriately calling `open` on macOS and `xdg-open` on Linux) so we can have a consistent code and remove some of the existing redundant code or unnecessary limiting code.
2018-07-02 12:50:19 -07:00
Dongbo Wang 0d9a3ac832
Refactor module code related to 'Get-Module -ListAvailable' (#7145)
* The major refactoring changes are:
- In `ModuleIntrisic.cs`, remove unneeded Windows-PowerShell-only code.
- In `ModuleUtils.cs`
   - use the new API `Directory.GetDirectories(string path, string searchPattern, EnumerationOptions enumerationOptions)` and `Directory.GetFiles(string path, string searchPattern, EnumerationOptions enumerationOptions)` to enumerate files and sub-directories within a directory path.
   - remove the unused parameter `bool force` from `GetDefaultAvailableModuleFiles(bool force, bool isForAutoDiscovery, ExecutionContext context)`
   - refactor the method `GetModuleVersionsFromAbsolutePath`. Add more comments and rename the method name.
- In `ModuleCmdletBase.cs`, refactor the method `GetModuleForNonRootedPaths` to `GetModuleForNames` to simply its implementation.
- In `PSModuleInfo.cs`
   - group the declarations of `Declared*Exports` fields together
   - rename `_detected*Exports` fields to `Detected*Exports` to group them together. They are internal fields and used outside `PSModuleInfo`.

* There is some perf improvement after this refactoring change:
- For `Get-Module -ListAvailable`, there is about 36% speed improvement for 94 default modules.
- For `Get-Module -ListAvailable -All`, there is about 14% speed improvement for totally 600 module files.
- For `Get-Module <name> -ListAvailable -List`, there is over 17x speed improvement for finding 13 modules from 600 modules. This is because we now filter names using the module file before creating a `PSMdouleInfo` object.
2018-07-02 11:00:27 -07:00
PetSerAl b12dce27ff Build: Fix a check to avoid null argument in case 'vcvarsall.bat' is absent (#7218) 2018-07-02 10:41:03 -07:00
Travis Plunk c43ae6a110 Update 'releaseTag' in 'tools/metadata.json' (#7214) 2018-07-01 00:15:21 -07:00
Ilya 0a3555064a Use .Net Core File.Delete() method to remove symbolic links and alternate streams (#7017)
.Net Core support processing symbolic links and alternate streams, and thus we can remove our P/Invoke code.
2018-07-01 00:08:28 -07:00
Andrew d04fef469b Merge Third Party Notices and License updates (#7203)
* Merge Third Party Notices

* Use capital J for 'json'
2018-06-29 11:46:19 -07:00
Steve Lee 3cc9d26bc2 Fix class searcher to ignore hidden properties (#7188) 2018-06-28 23:29:12 -07:00
Adam Gauthier c83e0e8462 Update the powershell executable location in building guide docs (#7205) 2018-06-28 23:14:08 -07:00
Ilya 839ecb866f Move to dotnet core 2.1.1 (#7161) 2018-06-28 23:10:10 -07:00
Aditya Patwardhan 15f6abe944 Added functionality to retry in Invoke-RestMethod and Invoke-WebRequest. (#5760)
Added two parameters, RetryCount and RetryIntervalSec to enable retry functionality. When retrying a verbose message is sent out to inform the user.
2018-06-29 09:06:53 +05:00
Darwin 68ab1e09a6 Adding ability to install previews side-by-side with production releases (#7194)
-preview switch:
 - installs pwsh-preview packages when a package manager is being used.
 - uses link name pwsh-preview when tar ball install is being done
 - results in preview release being available for calling manually, but does not become systemwide version
Issue #7177
2018-06-28 11:46:58 -07:00
Bruce Payette 1d549497cf Modified the -AsHashTable code to get the base object from the PSObject when (#7123) 2018-06-28 12:29:04 +05:00
Sergey Vasin adf267eb5f Fix second test in Send-MailMessage.Tests.ps1. (#7195) 2018-06-28 10:02:10 +05:00
Steve Lee 057eeddbd6 when using PSRP, if we receive text instead of xml, output it as error to help troubleshoot (#7168)
PSRP currently relies on XML for the transport messages.  When using PSRP over SSH, if the target side fails, it sends back a text message.  PSRP sees this and doesn't know what to do so it throws
a generic message which makes troubleshooting the issue more difficult.  Change here is to throw
the text message which now looks like:

>new-pssession : [test-machine] There is an error processing data from the background process. Error reported: Invalid argument '-np', did you mean:.

Previously:

>new-pssession : [test-machine] There is an error processing data from the background process. Error reported: Cannot process an element with node type "Text". Only Element and EndElement node types are supported..

Since it's processing one line at a time, not able to get the whole message.
2018-06-27 15:42:06 -07:00
Steve Lee 167b51c4d6 update build and packaging modules for Alpine (#7149) 2018-06-27 15:30:38 -07:00
Dan Travison 5e8b23e127 Allow Basic Auth over HTTPS (#6890)
* [FEATURE] Allow Basic Auth over HTTPS

* WSManTransportManager.cs: Simplify HTTPS check
Update comment in test to refer to the right exception type.

* Disable test until limi crash fo selected connection error paths is fixed

* Use Hex format for defining the expected HRESULT
2018-06-27 15:27:41 -07:00
Steve Lee 5f47fc0e8c Fix tab expansion for Get-Process on macOS (#7176)
* fix tab exapnsion for get-process on macOS

* add comment to address PR feedback
2018-06-27 12:48:42 -07:00
Robert Holt dfa1a31515 Add tests for module specifications (#7140)
* Add simple tests for module specifications

* Add comparison tests

* Add using namespace to shorten type names
2018-06-27 12:11:32 -07:00