Commit graph

6280 commits

Author SHA1 Message Date
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
Steve Lee 8829c01fa2 [feature] (#7101)
Revert "Set-Location should use path with wildcard characters if it exists instead of globbing (#5839)"

This reverts commit 7459b54639.
2018-06-27 10:26:37 +05:00
Steve Lee b1fbcee6d2 Fix trimming of whitespace when table is wrapped (#7184) 2018-06-27 10:24:03 +05:00
Sergey Vasin 7628f8819d Send-MailMessage: Update all parameters to support 'ValueFromPipelineByPropertyName'. (#6911) 2018-06-26 12:30:07 -07:00
Bruce Payette bacda46941 Fix the pref regression to the '-replace' operator after adding ScriptBlock support (#7135) 2018-06-26 12:27:16 -07:00
Dongbo Wang 13e925e13e
Revert "Make switch statement report correct error position when it fails to evaluate the condition" (#7182)
The fix causes a problem in debugging. When stepping over the scripts in debugging mode, the debugger will stop at the switch statement condition expression twice at the very beginning -- one for evaluating the condition, and one for iterating the condition.
2018-06-26 12:24:11 -07:00
Steve Lee e8d2a6b278 Fix adding padding when right justified (#7136)
Table formatter was overly aggressive in removing padding so even right justified output (default of numbers) gets incorrectly stripped of padding. Fix is when right justified, always add padding (because it's right justified, there's never trailing whitespace).
2018-06-26 12:35:22 +05:00
Christoph Bergmeister bbd48f60e0 Add location history for Set-Location to enable 'cd -' scenario (issue #2188) (#5051)
* Implement location history feature for Set-Location.
This makes it possible to go back to the last directory using 'cd -',
which is exactly the same syntax as on Linux shells.

* Use an existing stack implementation instead of relying on an environment variable and move logic for 'cd -' into the internal class of SessionState.Path.SetLocation
Keep the (additional) setting of an environment for Unix system in case of mixed usage of cd and Set-Location to provide consistency.

* Use a bounded stack with a limit of 1000 and adapt tests.
Remove setting environment variable on Linux as discussed in PR.

* Fix test: use get-location explicitly to avoid subtle difference in the path string (e.g. an additional slash at the end)
Make syntax to .net call of environment consistent with surrounding code

* Move initialization of _workingLocationHistoryStack into constructor of SessionStateInternal and set the limit to 20 as discussed in PR 5051.

* Make new BoundedStack class in engine utils internal
2018-06-26 12:21:38 +05:00
Steve Lee 7d72e38604 Updates to build for Alpine (#7139)
setdate.cpp was incorrectly assigning an int to a struct, fixed to initialize struct zero'd
update the typegen project in the bash script
added some help text at top of script for someone trying to build it
updated runtime to linux-musl-x64 instead of linux-x64 as Alpine distro uses the musl libc libraries instead of glibc which is used by most distros.
2018-06-25 14:51:30 -07:00
Ilya 4fc784e840 Bulk update code base to put 'null' on the right-hand-side of a comparison expression (#6949) 2018-06-25 14:37:09 -07:00
Dongbo Wang c77d0ceff2
Make switch statement report correct error position when it fails to evaluate the condition (#7151) 2018-06-25 14:07:42 -07:00
Darwin 53e6ec6ead install-powershell.sh filter prereleases (when available), params documentation (#6849)
Fixed #6815 by adding -allowprereleases parameter
Fixed #6405 by adding -allowprereleases parameter
Added parameters to documentation
Ready for prerelease repositories if Microsoft starts providing them
Added -skip-sudo-check for all distros
Fixed -interactivetesting should do nothing if -includeide was not used
2018-06-25 11:44:42 -07:00
Sergey Vasin ffca008726 Fix error when using Get-ChildItem c: (#7033)
* Fix error when using Get-ChildItem c:

* Fix New-Item test issue.

* Add tests for Get-ChildItem cmdlet.

* Add tests for New-Item cmdlet.

* Fix tests for New-Item cmdlet.
2018-06-25 10:15:57 -07:00
Robert Holt 9413fd3802 Remove MapSecurityZoneWithUrlmon method and related code (#7103) 2018-06-24 23:46:12 -07:00
Bruce Payette bbb4f2ea84 Fix for #4520 '-ArgumentList should accept @() or $null' (#6597)
* Fix for #4520 '-ArgumentList should accept @() or $null'
Removed the [ValidateIsNotNulOrEmpty] attribute from the parameter.

* Fixed null and @() empty list tests to not both test null

* [Feature] Fixed test issue on non-Windows; added code to suppress displaying new windows on Windows.
2018-06-22 11:29:46 -07:00
Steve Lee 4ad56b3029 Remove PSReadLine from Solution (sln) file (#7137) 2018-06-22 23:22:24 +05:00
Steve Lee 6c9eea6390 Add back ADSI and WMI type accelerators (#7085) 2018-06-21 09:57:14 -07:00
Aditya Patwardhan d76cdc3c5c Fix New-TemporaryFile online help URI (#6608) 2018-06-20 12:15:50 -07:00
Dongbo Wang f591f4d61f
Comment about dynamic members for the DotNetAdapter 'GetMember' and 'GetMembers' (#7087) 2018-06-20 00:23:55 -07:00
Bruce Payette 3a4c410499 Fix for #6855 - Measure-Object should handle scriptblock properties. (#6934)
Measure-Object should handle `ScriptBlock` properties. Fixed by renaming `MshExpression` to `PSPropertyExpression` and making it public. Then in `MeasureObjectCommand`, lifting it up to the parameter level. Previously the implementation exposed the Property as a string and
wrapped it internally as a `PSPropertyExpression`. Now the parameter type is `PSPropertyExpression` directly allowing for both wildcard strings and `ScriptBlock`.

`PSPropertyExpression` now lives in a public namespace where it can be used by cmdlet and script authors to easily add the same type of functionality to their commands. I also modified `PSPropertyExpression` to handle hashtables properly as objects so
         @{prop = 3} | measure-object prop
and
         @{prop = 3} | measure-object {$_.prop}
will work the same. (Previously the example using just the property name would fail.)
2018-06-20 00:23:11 -07:00
Steve Lee b25c1f6cbb When installing using MSI, set the working directory of the shortcut to the user home directory (#7072)
Leverage the -WorkingDirectory parameter on pwsh.exe to set the initial location.

Fix #5705
2018-06-19 18:33:01 -07:00
Steve Lee abcdce4e3e Don't fail if SaferPolicy API is not available on Win10 IoT or NanoServer (#7075)
* don't fail if SaferApi is not available
* fix install-powershellremoting to work on Windows PowerShell 5.1
2018-06-19 17:53:32 -07:00
Dongbo Wang bda8fd376c Use empty array for Functions/Cmdlets/AliasesToExport to follow the best practice (#7108) 2018-06-19 17:51:28 -07:00
Dongbo Wang d6250e8086
Revert the PR #7023 "Set the cursor to the place where a user hits tab key" (#7117)
Reverts PowerShell/PowerShell#7023 due to a regression introduced by it.
2018-06-19 17:40:29 -07:00
Aleksandar Nikolić bd598f3f1e Fix typos in DOCSMIGRATION.md (#7094) 2018-06-19 08:24:35 +05:00
Christoph Bergmeister 0487a1be2f Disambiguate icon on Windows for preview builds/installers to use Powershell_av_colors and make daily build use Powershell_avatar instead (#7086)
Closes #6317
Using the preview side-by-side with the RTM version is a pain/confusing due to the icons being the same.
This makes the preview build (i.e. the embedded icon in `pwsh.exe`) and MSI installer package (shortcut icon and context menu) use the [Powershell_av_colors icon](https://raw.githubusercontent.com/PowerShell/PowerShell/master/assets/Powershell_av_colors.ico)
![image](https://user-images.githubusercontent.com/9250262/41491336-6e354936-70f0-11e8-965e-9b5e83be925b.png)

Therefore change the icon of the daily build (which used to use the Powershell_av_colors icon) to [Powershell_avatar](https://raw.githubusercontent.com/PowerShell/PowerShell/master/assets/Powershell_avatar.ico)
![image](https://user-images.githubusercontent.com/9250262/41491346-80f890a0-70f0-11e8-9ab5-bb789454c134.png)
This means that people like me who have a shortcut to pwsh of the daily build pinned to the taskbar, probably need to re-pin it to the taskbar to receive all changes (otherwise one will only get the change in the icon of the window)

Note: The `Test-IsPreview` method had to be moved to the build module, which is OK because the packaging module has a declared dependency on the build module in its manifest.
2018-06-18 15:54:11 -07:00
Jan Pazdziora 8489532f25 Fedora 28 was released, Fedora 26 and 25 were EOL'ed. (#7079)
With PowerShell/PowerShell-Docs#2497 merged, the links from README.md are no longer valid.
2018-06-18 15:27:57 -07:00
Hubert Bukowski 9ac701dbee Fix conditions for transcription of Write-Information command. (#6917)
Makes a transcription of Write-Information command consistent with $InfomrationPreference variable.
2018-06-16 21:11:21 +05:00
Dongbo Wang 00b0af13d8
Add 'CompatiblePSEditions' to PowerShell Core built-in modules (#7083) 2018-06-15 15:28:58 -07:00
Travis Plunk a5ec565cae
Enable NuGet Package Registration for compliance (#7053)
update the Windows release build script with the ability to capture all the project.assets.json files
add a Windows build to use the new feature in the release build script
update the Linux release build script with the ability to capture all the project.assets.json files
  -no new build is needed because signing is not currently automated
2018-06-15 11:07:27 -07:00
Paul Higinbotham 6fa1e86f2d Added copy env vars from ProcessStartInfo to key/pair array used in creating ssh process (#7070)
This addresses issue #6207. During SSH remoting on Linux machines, when PowerShell on the client creates the SSH process to connect to the target machine, it was not passing in environment variables from the parent process, and this was preventing ssh-agent key management from working.

This change adds a helper function to create environment variable key/value pairs for the created SSH process, based on the passed in ProcessStartInfo object.
2018-06-15 11:06:38 -07:00
Jianyun 8805ca20aa Set the cursor to the place where a user hits tab key (#7023) 2018-06-14 23:04:31 -07:00
Sergei Vorobev 69977718db Add instructions to update homebrew formula for the preview version powershell (#7067) 2018-06-14 12:03:17 -07:00
Ilya 81244fb907 Avoid calling native APIs to check for existence of FileSystem items (#6929)
- Use File.GetAttributes() instead of p/invokes to check for existence of FileSystem items. The method throws access exceptions which we use for better error messages.
- Remove the word 'Native' from method names.
2018-06-14 11:35:44 -07:00
Dongbo Wang 9141a3599f Update 'internals.md' with the latest build changes (#7058) 2018-06-14 23:06:16 +05:00