Commit graph

6128 commits

Author SHA1 Message Date
Dongbo Wang 87bec49b27 Cleanup: remove the unneeded type 'RemotingCommandUtils' (#7029) 2018-06-14 08:35:55 +05:00
Robert Holt 7e05226dd5 Fix markdown and spelling errors in CHANGELOG.md (#7064) 2018-06-13 17:53:55 -07:00
Dongbo Wang 74628b61f6
Fix the preview macOS package link (#7061) 2018-06-13 16:15:39 -07:00
Dongbo Wang 9804ae5f97
Merge the v6.1.0-preview.3 release branch to master (#7060) 2018-06-13 15:59:27 -07:00
Paul Higinbotham 3eec0c42b2 Removed unneeded code that forces ARM platforms to run PowerShell in CL mode (#7046) 2018-06-13 12:01:32 -07:00
Dan Thompson ce3cb68551 Make Select-Object/ForEach-Object/Where-Object see dynamic properties (#6898)
Dynamic (DLR) objects work in some places today, but not others.  This change expands that support to ForEach-Object, Where-Object and the family of cmdlets that use 'MshExpression' (Select-Object, etc.).

This change addresses both wildcard and non-wildcard cases. In wildcard cases, it uses the existing support of generating PSDynamicMember objects for names returned by GetDynamicMemberNames.

In non-wildcard cases, a dynamic property access is attempted whether or not the name shows up in GetDynamicMemberNames, but a truly "blind" access is only attempted if we see that the base object is an IDMOP. If the dynamic access fails, you'll get the same or a similar error experience as before ("The property 'Blarg' cannot be found", or no error at all, depending on the cmdlet and the strict mode setting).

The included test coverage includes a stub for the.ForEach operator--once people are happy with this change, I can continue by adding support there.

This change should allegedly also have positive perf impact, though in actual perf testing, although it does seem ever-so-slightly faster, I found it difficult to measure much difference at all.
2018-06-12 23:48:34 -07:00
Dongbo Wang 3a5a3e4c6e Remove unneeded "Windows-Full" modules (#7030)
- Remove the Windows-Full folder under src/Modules
- Move content in Windows-Core+Full and Windows-Core to Windows under src/Modules
2018-06-13 09:06:41 +05:00
Steve Lee c2bbc2291a add additional checks for test that passes inconsistently (#7051) 2018-06-12 14:35:19 -07:00
Ilya e177fcaef6 CodeFactor code style cleanup: replace literal empty strings with 'string.Empty' (#6950) 2018-06-12 12:30:10 -07:00
Steve Lee 11a98c47fb Update third party notices (#7042)
Based on adding a reference to new assemblies, need to update ThirdPartyNotices.txt
Add ThirdPartyNotices to all packages
2018-06-12 10:58:05 -07:00
Aditya Patwardhan 0d67d4dc3a Merged PR 3115: Use Directory.CreateDirectory instead of DirectoryInfo.CreateSubDirectory
Change to use Directory.CreateDirectory because of regression introduced by https://github.com/dotnet/corefx/pull/27810 in creating a subdirectory under root path.
2018-06-11 23:06:08 +00:00
Christoph Bergmeister fbbca53f4c AppVeyor build matrix: more efficient build job split to reduce total time by another 5 minutes (#7021)
Closes #6944

Following PR #6945, further, reduce the total build time (without any disadvantages) by around 5 minutes by making sure there is a more even split between the 2 build jobs (the 2nd build job used to be much shorter).
Therefore this PR moves also the xUnit and Pester-Admin tests into the 2nd build job. If it is a daily/feature test commit, then the feature tests will also happen (only) in the 2nd build job. Because both jobs now run tests, the failfast option was removed. The final question from my side is whether running tests in 2 build jobs is OK for the daily build, which uploads code coverage results?

The time to wait for the AppVeyor build results is now 15 +/- 2 minutes, which is a huge improvement to what used to be around 28 minutes before the build matrix was introduced.
2018-06-11 14:18:51 -07:00
Travis Plunk f08a031f88 Merged PR 3079: Resolve Linux SxS conflicts and issues
Fix man page conflict between stable and preview Linux package
  - rename preview man page pwsh-preview
Fix /etc/shell entries not being created correctly for preview packages
2018-06-08 23:31:38 +00:00
Steve Lee 50d061148d Remove 'SemanticVersion' from 'knowntypes' list in serialization code to enable interop between WinPS and PSCore (#7016)
PowerShell serialization has a list of known PowerShell types. When an object is deserialized containing a known type it tries to deserialize the object to that specific type and throws an exception if it can't succeed. SemanticVersion only exists in PSCore6 so when remoting from Windows PowerShell or importing clixml generated from PSCore6 that contains SemanticVersion, it fails.

With this fix, it will be rehydrated as a "PSObject" with "Deseriealized.System.Management.Automation.SemanticVersion" in the 'TypeNames' in both Windows PowerShell and PowerShell Core.
2018-06-08 11:38:14 -07:00
Christoph Bergmeister fa544c33db Update links that contain 'en-us' culture (#7013)
Update links that contain 'en-us' culture to remove 'en-us' culture (if possible) and in some cases update to newer re-directed link to docs.microsoft.com
2018-06-08 10:49:03 +05:00
Dongbo Wang d8a2861fa9 Update versions in README.md 2018-06-07 23:02:21 +00:00
Dongbo Wang 6c914c0faa Update the ChangeLog.md for 6.1.0-preview.3 release 2018-06-07 21:15:03 +00:00
Dongbo Wang e9e8dc2313
Add Andrew to the default reviewers of the build related files (#7019) 2018-06-07 12:55:14 -07:00
Josh 0d51ea7aea Fix links to PowerShell install docs (#7001) 2018-06-07 17:24:41 +05:00
Bruce Payette 5b90423e63 Fix for #6880 Progress panel displays incorrectly on UNIX when the user is typing. (#6972)
This fixes issue #6880 where user input interferes with the way the progress panel is displayed. If the user types any input while running a command displaying progress, that input would be echoed causing the terminal's cursor position to change. On the next progress write, output would be written using the new, incorrect cursor position. This had the effect of causing the progress pane to "march" across the screen if the user held down a key. The fix is fairly simple - update the physical cursor position right before updating the screen. This still leaves a very small window where an individual update might be off by a character or two but this is not cumulative and will be corrected on the next update. I've added code to SetBufferContents() to do this but only on UNIX. It's not a problem on non-VT100 style consoles.
2018-06-07 08:40:04 +05:00
Travis Plunk 587ce9df81 fix mac package name 2018-06-06 13:28:34 -07:00
Travis Plunk 1aec38e14f make sure the path comparison is case insensitive. 2018-06-06 13:05:10 -07:00
Travis Plunk b869f1b168 Get the fix for this issue with installing fpm
https://github.com/jordansissel/fpm/pull/1494
2018-06-06 12:15:33 -07:00
Travis Plunk a3a5c6b774 remove PSReadline from signing 2018-06-06 11:18:20 -07:00
Travis Plunk 4192463ce6
fix issue with setReleaseTag using variable meant for non-release branches during a release (#7011)
There was a regression in the script where a variable meant for non-release branches was used during releases
2018-06-06 10:55:28 -07:00
Travis Plunk cecdd1ef80
make macOS package use a consistent path (#7006)
Address mac portions of PowerShell/PowerShell-RFC#115 (comment)

Make path when stable /usr/local/microsoft/powershell/6
when not stable (preview) /usr/local/microsoft/powershell/6-preview and symlink name pwsh-preview
allow side-by-side install of stable and preview
Also:

fix an issue where the utime work around for mac requires sudo
refactor some code into common functions
2018-06-06 10:28:22 -07:00
Steve Lee 92cb949cac Use PSReadLine 2.0.0-beta2 from PSGallery (#6998)
Removed building PSReadLine from the repository. Instead, change to downloading from PSGallery.
2018-06-06 09:42:19 -07:00
Dongbo Wang b20dd31398
Fix parser to continue parsing key-value pairs after an If-Statement value in a HashExpression (#7002)
After parsing `if () { }`, new lines are skipped in order to see if either `elseif` or `else` is present. When neither is present, we should resync back to the pointer before skipping those possibly available new lines, so that the new line tokens can be utilized by the subsequent parsing.
2018-06-06 09:38:05 -07:00
Dongbo Wang 2429b43181 Skip compiling the non-supported cmdlets on Unix in System.Management.Automation.dll (#6939)
This is to keep the cache in InitialSessionState in sync with the actual available cmdlet types in System.Management.Automation.dll
2018-06-06 08:08:49 +05:00
Christoph Bergmeister faf832401f Fix broken links due to PR 6899 that removed GitHub docs on installation docs, known issues and breaking changes due to complete migration to docs.microsoft.com (#6981)
* Fix broken installation links in README.md

* fix remaining broken links due to removal of breakingchanges and knownissues docs

* Remove en-us culture from docs links in readme

* Remove last en-us culture link from issue template
2018-06-05 19:37:14 -07:00
Dongbo Wang 6ea1389571
Skip dotnet-cli initialization and stop caching the 'dotnet' folder for Travis CI (#7007) 2018-06-05 15:51:13 -07:00
Robert Holt f559acfae1 Change packaging to differentiate only between major versions and previews (#6968)
Change the *nix packaging over with the following changes:

Package name (as used by e.g. apt):
Non-preview releases are namedpowershell
Preview releases are named powershell-preview
Installation path:
No longer looks like /opt/microsoft/powershell/6.1.0/ or /opt/microsoft/powershell/6.1.0-preview.1/
Non-previews go to a path like /opt/microsoft/powershell/6/
Previews go to a path like /opt/microsoft/powershell/6-preview/
Path to executable symlink:
Allows SxS with preview
Non-previews linked to /usr/bin/pwsh or /usr/local/bin/pwsh on macOS
Previews linked to /usr/bin/pwsh-preview or /usr/local/bin/pwsh-preview on macOS
Implements PowerShell/PowerShell-RFC#115 (comment)
2018-06-05 12:51:47 -07:00
Christoph Bergmeister 2ec3056f9e Use Appveyor matrix for faster PR builds (#6945)
Related: #6944

Reduce PR build time by 5 minutes by:

Having Packaging as a separate build job in a matrix -> runs in parallel in PR builds because the Microsoft account is a paid account that allows that (at no additional costs)
Not caching the dotnet folder anymore, which is too large and the overhead of zipping/unzipping/upload/download does not pay off (and fails in forked builds that are on a free AppVeyor account due to the size).
Setting the environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to 1 because the initialization of the dotnet CLI cache (1 minute) does not pay off for the whole build.
The total build time of builds on a fork that is on a free AppVeyor account and therefore does not have parallelism, remains the same due to the time saving of redundant caching.

This is just a simple example of what we can easily achieve, we could continue this pattern and split the test runs as per the referenced issue to bring PR builds down to 10 minutes (but this will incur an increase for fork builds on free AppVeyor accounts)
2018-06-05 10:48:44 -07:00
Klaudia Algiz cda6ef175c Remove not initialized variable $IsElevated from test in New-Item.Tests.ps1 (#6746)
* Remove not initialized variable  from PowerShell tests

* Separate the tests that requires no elevation from the others.
2018-06-05 10:26:04 -07:00
Sergey Vasin 3b1a4a4722 Replace "Dbg.Assert" with 'if () throw' in CSVCommands.cs.. (#6910)
Add more useful messages.
2018-06-05 22:12:57 +05:00
Christoph Bergmeister f54085f8a3 Create JumpList in background thread to improve performance (#6985)
* Perform JumpList creation in background thread to improve performance when pwsh owns the window (i.e. when the Jumplist has to be created)

* Move JumpList creation to a later stage to allow for more code that might make it exit earlier as suggested in PR review by @iSazonov
2018-06-05 17:44:45 +05:00
Ilya b66013d11c
Disable some StyleCop rules (#6986)
* Disable some StyleCop rules
* Add CodeFactor status badge in README.md
2018-06-05 16:32:06 +05:00
Dongbo Wang 0b32d0c04b [Feature] Minor update on 'GetFileSystemItem' (#6984) 2018-06-05 09:51:04 +05:00
Jan Pazdziora ebc7cdf847 Make the build step fail when the curl operation fails. (#6961)
Without the pipefail, the step always succeeds and the layer gets
cached, resulting in confusion during the next step failing and
subsequent rebuild attempt.
2018-06-04 13:18:07 -07:00
Frederik Carlier d663b41bd5 Remove dependencies on libcurl, libunwind, matching the .NET Core behavior (#6964) 2018-06-04 13:15:27 -07:00
Jan Pazdziora 3cb2424d8e Fix the double curly bracket typo. (#6960) 2018-06-04 12:22:10 -07:00
Ilya d67d87caf0
Add Settings.StyleCop file (#6930)
Disable:
1.SA1402 FileMayOnlyContainASingleType
2.SA1403 FileMayOnlyContainASingleNamespace
3.SA1101 PrefixLocalCallsWithThis
4.SA1126 PrefixCallsCorrectly

Add custom global config file stylecop.json
2018-06-04 10:41:10 +05:00
Steve Lee 5dc7a6cb07 Add Windows Compatibility Pack 2.0.0 to PS Core and adopt the official .NET Core 2.1 (#6958)
To support PowerShell modules built with .NET Windows Compatibility Pack, we decided that it was best to ship the WCP assemblies with PS Core. This also adds many new .NET APIs be default while only adding ~3.5 MB additional disk footprint (to a ~137 MB install currently).
Also update the build to adopt the official .NET Core 2.1.
2018-06-03 22:06:26 -07:00
Ilya 57b3d3380b
Cleanup FileSystem provider (#6909)
The cleanup is coming from a code review to cleanup psl. Here we clean up the side branch of the code that will allow later to clean up a branch which uses psl.
- IO.FileInfo does not make system calls in constructor. So we can create the object and then use the required attributes without direct call IO.FileInfo.GetAttributes() ( SafeGetFileAttributes() ). This allow us to exclude some p/invoke calls in our code in later cleanups. Also we get unified code for both Windows and Unix.
- Remove SafeGetFileAttributes() and WinSafeGetFileAttributes(). Currently .Net Core support file attributes on all platforms in fastest way and we can remove our workaround. We get a regression in rare case (for files like pagefile.sys). Fix is ready in CoreFX, we get it in 2.1.1. I suggest ignore the regression because this is a very-very rare situation (Get-ChildItem c:\pagefile.sys -Hidden). The .Net Core team was not even able to create an artificial test for such files and uses a real pagefile.sys file for the test. Also the enumeration is still working (dir c:\ -hidden).
- Re-add test which we lost in #4050. The test is pending because of the regression.
2018-06-04 10:00:56 +05:00
Sean Wheeler 1f918bb648 Migrating docs from source to docs repo (#6899)
* migrating docs to docs repo
2018-06-01 14:28:09 -07:00
Christoph Bergmeister b851b55ec6 Add Jumplist 'Run as Administrator' to Taskbar on Windows (#6913)
Closes #6649

This is a port of existing C++ Windows PowerShell code from MainEntry.cpp
Some of the code has been copied and minified from the WindowsApiPack.

The code is not compiled for Linux (not sure also another condition is needed for Windows on ARM?).
The code checks if the PowerShell process has a window handle by checking the startupinfo and only then tries to populate the list (and also checks if there is a slot available in the jumplist).
Tested on Windows 10 1803, jumpLists have been supported in Windows since Windows 7, which matches what PowerShell Core supports.
2018-05-31 12:24:19 -07:00
Ilya a5f77955e8
Fix xUnit test GetTempFileName (#6943)
Use Path.GetTempFileName() to get a temporary file.
2018-05-31 11:03:14 +05:00
Ilya c297eac50e
Cleanup NonWindowsGetDomainName() (#6948)
Add an optional extended description…
2018-05-31 10:18:33 +05:00
Sergei Vorobev 115d0715dc Remove myself (@vors) from codeowners for parser (#6952)
I was not able to provide reviews on the vast majority of the auto-assigned reviews.
I don't see a point to keep this auto-assignment.
2018-05-29 09:14:43 +05:00
Steve Lee a707702aac remove deprecated file that is no longer used (#6922) 2018-05-24 16:54:02 +05:00