Commit graph

4964 commits

Author SHA1 Message Date
jeffbi 1688703caf Make Get-ChildItem follow symlinks on demand, with checks for link loops (#4020)
Add the dynamic parameter `-FollowSymlink` to `Get-ChildItem`.
Add a mechanism for tracking visited directories.
Add native code to get device/inode information on Unix/Windows.
Add warning when refusing to enter an already-visited directory.
2017-07-06 12:28:27 -07:00
Tim Curwick d1e05efbf1 Added comma to the list of replaced characters in assemblyname (#4136) 2017-07-06 11:32:54 -07:00
Steve Lee 36eaab2809 Static analysis: Fix usage of XmlReader to ensure XmlResolver is null (#4108)
* the default XmlResolver will attempt to resolve external resources, recommendation is to explicitly set to null which
will raise exception if malicious xml attempts to cause xmlreader to access external resources

* added DTDProcessing and related to XmlReaderSettings
2017-07-06 09:09:57 -07:00
Steve Lee dda482eaac Add markdown lint errors as test failure message (#4189) 2017-07-05 21:47:42 -07:00
zackschuster 8205edabf3 Update .NET CLI information in windows-core.md (#4176) 2017-07-05 16:00:52 -07:00
Bruce Payette ece27ff687 Fix spurious error generated when importing cmdlets from an in-memory assembly (#4117) 2017-06-30 15:36:38 -07:00
Dongbo Wang 3e35fb9918 Move powershell to 2.0.0-preview3-25426-01 using the .NET CLI 2.0.0-preview2-006502 (#4144) 2017-06-30 13:07:14 -07:00
Paul Higinbotham a2922d6ac4 Fix for SSH remoting when SSH client abruptly terminates (#4123)
* Fix for SSH remoting when SSH client abruptly terminates

* Put error message in localizable string resource

* Renamed error string per code review request

* Removed extra error==null check
2017-06-29 11:14:33 -07:00
Ilya a8e3d8968f Refactor MSBuild project files by adding the common property file 'PowerShell.Common.props' (#4106)
`AssemblyVersion` and `FileVersion` are now inferred from the `Version` property, which is inferred by `VersionPrefix`. So now both `AssemblyVersion` and `FileVersion` are 6.0.0.0 for each of PowerShell assemblies, and the `ProductVersion` and `InformationalVersion` are 6.0.0.
2017-06-29 10:25:49 -07:00
Andrew ecefb50d0d Fixing Import-Module on Linux for special cases of NestedModules/RootModule path format (#4010)
* IPMO fix for some cases of NestedModules/RootModule path syntax

* Added tests for #3693 fix

* Updated tests
2017-06-28 16:35:33 -07:00
Steve Lee 40c479d071 Address static analysis issues in SSH remoting (#4083)
* address static analysis issues
- remoteRunspaces is not used TFS:10618323
- not checking return value of ResumeThread() TFS:10618344

* fixed magic number use

* changed magic number to Uint.MaxValue
2017-06-28 16:27:54 -07:00
Wojciech Sciesinski b25b8df7ca Fix the link to .Net Core Foundation (#4127) 2017-06-28 10:43:16 -07:00
Steve Lee 3fbaf41c1a add CODE_OF_CONDUCT.md (#4109)
* add CODE_OF_CONDUCT.md

* updated spelling for CODE_OF_CONDUCT.md

* Fixed markdown lint error

* added link to CODE_OF_CONDUCT.md as expected by GitHub
2017-06-28 10:34:09 -07:00
Steve Lee 042a6f2534 Need explicit -command to execute command in Read-Host output test (#4103) 2017-06-28 10:13:37 -07:00
Jason Shirk ff5609785b Minimize writing ANSI escape sequences in PSReadline (#4110)
Instead of changing Console.*groundColor on every character, only set
the color when the color changes - this avoids writing out ANSI escape
sequences after every character.

Fixes #4075
2017-06-27 23:22:16 -07:00
Keith Hill 27e47f9ee1 Implement Unicode escape parsing (#3958)
* Implement Unicode variable width `u{xxxxxx} escape sequences.
2017-06-27 22:55:57 -07:00
Paul Higinbotham 2ee9705751 Add missing timestamper cert to the newer catalog signing APIs for Get-AuthenticodeSignature (#4061)
* Fixed missing functionality to add timestamper cert for the newer catalog signing APIs for Get-AuthenticodeSignature
2017-06-27 14:59:52 -07:00
Andrew e2e07b1830 Change New-ModuleManifest encoding to UTF8NoBOM on non-Windows platforms (#3940)
* Change New-ModuleManifest encoding to UTF8NoBOM

* Addressed PR feedback

* Fixed test for Travis CI

* Updated tests
2017-06-27 12:48:25 -07:00
Ilya 9e41c647a9 Enhance ResGen tool to support generating C# binding file for a specific .resx file (#3918) 2017-06-26 10:48:24 -07:00
mrpnkt 83b18570ea Run PowerShell in latest Kali (#4035)
* Run PowerShell in latest Kali

* markdown error in pull request

* Update linux.md

* code block fix

* fixed typo

* fixed typos
2017-06-25 12:15:06 -07:00
Maria Romero 471f4e8a48 Add tab completion for Export-Counter -FileFormat parameter (#3856)
* add tab completion for -FileFormat parameter

* update expected error for invalid -FileFormat test case
2017-06-25 12:13:57 -07:00
Mike Richmond a291834f39 Revert "Set assembly versions by MSBuild" (#4091) 2017-06-23 10:17:25 -07:00
Dongbo Wang b7a7e9980c Update the release steps (#4082) 2017-06-23 09:36:43 -07:00
Ilya 84d458bb4c Add description of recommended settings for VS Code (#4054) 2017-06-23 09:23:50 -07:00
jeffbi 5ee4ec1e1e Make Move-Item work with its -Include, -Exclude, and -Filter parameters (#3878)
* Make Move-Item work with its -Include, -Exclude, and -Filter parameters (#2385)

Invoke the correct overload of SessionState.Path.GetResolvedPSPathFromPSPath, passing the cmdlet context object.

* Update tests per code review.

* Changes per code review.

* Remove stray comment
2017-06-22 19:14:51 -07:00
Ilya c549925f67 Set assembly versions by MSBuild (#3917)
* Update assemblies versions by MSBuild and create a new PowerShellAssembly.props file to consolidate properties.

* Move import on first place

* Move to "6.0.0-beta.3"
2017-06-22 18:21:36 -07:00
Dongbo Wang 07db8c827b Update docs and scripts for v6.0.0-beta.3 release 2017-06-22 13:55:47 -07:00
Ilya aa97fe7cd1 Resx - remove trailing white spaces and extra Newline at EOF (#4047) 2017-06-22 13:45:11 -07:00
Aditya Patwardhan 7491417bf9 Fixed BaseDirectory tests by adding -c instead of positional argument (#4078) 2017-06-22 13:35:04 -07:00
Staffan Gustafsson b65bc62934 Add type inference for Foreach-Object -MemberName (#3972)
This PR adds type inference support for the 'MemberName' parameterset for Foreach-Object.

Both of the following should work:

```
    Get-Process | % {$_.MainModule} | % Com<Tab>
    Get-Process | % MainModule | % Com<Tab>
```

Before this change, only the first line worked, this PR addresses the second line.

Fixes #2596
2017-06-22 13:34:33 -07:00
Aditya Patwardhan c7b959bd6e Make CodeCoverage tests work with CodeCov.io and related fixes (#4050)
* Fixed OpenCover module and CodeCoverage launcher script

* Changes to layout of package caused some changes to package path.
* Added Test modules from tests\tools\modules
* Fixed Get-ChildItem test
* Added convertor for converting OpenCover output file to JSON.
* Updated how the file is uploaded to CodeCov.io

* Addressed code review comments
2017-06-21 19:20:10 -07:00
Dongbo Wang 3b6c87d873 Update host-powershell doc for beta.3 release (#4071) 2017-06-21 18:53:39 -07:00
Steve Lee 18cddc99eb with change of positional parameter to powershell.exe from -command to -file, need to update some feature tests (#4058) 2017-06-21 18:47:56 -07:00
Dongbo Wang da8dd28942 Refactor CompletionCompleters.cs to avoid constructing unnecessary CompletionContext instances (#4048) 2017-06-21 11:43:06 -07:00
Ilya 20862d6204 Check the dotnet-cli version in Start-PSBuild (#4045) 2017-06-21 09:32:06 -07:00
Dongbo Wang 2e8ad72ca2 Update CHANGELOG.md (#4059) 2017-06-20 16:45:49 -07:00
Ilya 598cebf7b2 Add cache for GetApplicationBase (#3969) 2017-06-20 15:08:02 -07:00
Dongbo Wang 05dffcd1aa Update release version 2017-06-20 14:14:38 -07:00
Travis Plunk 5a84e60c13 Remove nightly docker images (#4052) 2017-06-20 10:42:26 -07:00
Steve Lee 3543498ee3 Adding a slightly bigger window to 'Start-Sleep' test. (#4049) 2017-06-20 09:49:49 -07:00
jeffbi 06dfe41e7d Enable Send-MailMessage on CoreCLR (#3869)
* Enable Send-MailMessage for PowerShell Core
* Update cmdlet entry in DefaultCommands.Tests.ps1
* Changes per code review:
  * Add check for SMTP server
  * Send mail to/from currently logged-in user on currently-named machine
  * Do not try to clear/create the mailbox before the test
  * Add validation of Subject
2017-06-19 18:19:25 -07:00
Ilya f30b06fe7c Add 'CSharpVersion7' member into public 'Language' enum (#3933)
Public enum 'LanguageVersion' from 'Microsoft.CodeAnalysis.CSharp'
already contains 'CSharp7' member.
After moving PowerShell to .Net Core 2.0 we should add 'CSharpVersion7'
member into public 'Microsoft.PowerShell.Commands.Language' enum too.

This will allow 'Add-Type -Language CSharpVersion7'
2017-06-19 18:09:15 -07:00
Steve Lee a66cd0b620 Remove ClrVersion property from $PSVersionTable (#4027)
* ClrVersion property of $PSVersionTable is not useful with CoreCLR and end users should not be using it
that value to determine compatibility.  Recommendation from dotnet team is to remove that property.

* Removed internal members used for CLRVersion

* removed CLRVersion from FullCLR build as well

* added additional information to run `start-psbootstrap -buildnative` if cmake is not found
2017-06-19 15:10:36 -07:00
Steve Lee 41f65de57c Change positional parameter for powershell.exe from -Command to -File (#4019)
Previously powershell.exe treated unknown arguments as a command line to execute. To align with POSIX so that things like shebang scripts work correctly, we are changing powershell.exe so that it treats unknown arguments (aka positional argument) as a file. This means that `powershell foo` will now attempt to use `foo` as a PowerShell script whereas previously `foo` would be treated as a command to execute. This doesn't affect existing usage of either -File nor -Command. Fixed tests that didn't explicitly use -Command parameter.
2017-06-19 12:17:56 -07:00
Tadas Medisauskas 437d773597 Start-Sleep: add 'ms' alias to '-Milliseconds' (#4039) 2017-06-19 12:15:31 -07:00
Travis Plunk a8f9826f08 Remove unused P/Invoke method declarations (#4041) 2017-06-19 12:10:30 -07:00
Aditya Patwardhan 2ae5d071ce Fix about_* topic help issues and a few tab completion regressions (#4014) 2017-06-18 18:27:34 -07:00
Dongbo Wang b4973fc920 Move PowerShell back to .NET Core 2.0.0-preview1-002106-00 (#4026) 2017-06-15 16:29:25 -07:00
Dan Travison 039ed6764d Strip authorization header on redirects with web cmdlets (#3885)
Invoke-WebRequest and Invoke-RestMethod cmdlets will now strip authorization header on redirect unless the new parameter `-PreserveAuthorizationOnRedirect` is specified.

The FullCLR implementation uses WebRequest to perform the request which silently strips the Authorization header when a redirect occurs.

The CoreCLR implementation uses HttpClient to perform the request which does not strip the authorization header. The change explicitly handles the initial redirect, removes the authorization header and submits the request to location in the response.

Fixes #2227
2017-06-15 15:52:08 -07:00
Aditya Patwardhan 26a44abcec Added logic in AssemblyLoadContext to load assembly from GAC. (#3981) 2017-06-15 13:25:59 -07:00