Commit graph

4610 commits

Author SHA1 Message Date
Jason Shirk 8c08c7b382 use global nuget package cache (#2987) 2017-01-17 13:00:52 -08:00
Jason Shirk c3588c936e Use (n) for offline file length formatting (#2986) 2017-01-17 13:00:19 -08:00
Jason Shirk 7cd5935595 Use correct win32 console mode w/ external commands (#2991)
At startup, we need to save the current console mode before potentially
enabling VT100 support.

Then, when running an external command, we should use that initial
console mode instead of whatever mode we changed it to.

An application can't rely on the shell enabling VT100 because enabling
by default can cause problems for some applications, therefore
Windows applications must enable VT100 themselves.
2017-01-17 12:56:23 -08:00
Ilya 9b23e1e1fe Fix error handling in parsing 'using' statement (#3007) 2017-01-17 12:54:43 -08:00
Jason Shirk 02b5f357a2 Remove trailing whitespace (#3001) 2017-01-16 13:31:14 -08:00
Sergei Vorobev f4f576c92b Rename Wait-CompleteExecution to Wait-UntilTrue 2017-01-12 14:25:07 -08:00
Sergei Vorobev 684a25b9ea Fix Wait-CompleteExecution usage 2017-01-12 14:25:07 -08:00
Sergei Vorobev fab25c5d50 Remove -Force from Import-Module in tests 2017-01-12 14:25:07 -08:00
Sergei Vorobev ab06adf774 Another attempt to make native timer test less flaky 2017-01-12 14:25:07 -08:00
Hemant Mahawar 4c41e3c34d Added Area-DSC 2017-01-12 09:12:48 -08:00
Paul Allen c43de5a19f Add dependent symlinks in package for libmi.so 2017-01-10 17:44:04 -08:00
James Truher [MSFT] c97ca777df Jameswtruher/travisdailybuild (#2958)
* Stifle progress output in build.psm1 for some operations

Modify test failure presentation to use platform available XML methods

* Add timeout support for returning runtime parsing errors

Some of the language/parser tests have been hanging in a non-reproducable manner which
causes the CI system to invalidate the entire run. This change adds support for timeout
which will fail a test if it runs to long, rather than invalidate the entire run.

current behavior is still supported, and is not done in a new session:
PS> get-runtimeerror -src '1/'
At line:1 char:3
+ 1/
+   ~
You must provide a value expression following the '/' operator.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : ExpectedValueExpression

Adding a timeout will do the operation in a async powershell session
PS> get-runtimeerror -src '1/' -timeout 5
You must provide a value expression following the '/' operator.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : ExpectedValueExpression

If the operation takes longer than the supplied timeout, a timeout error will be returned
PS> get-runtimeerror -src 'start-sleep 6' -timeout 2
get-runtimeerror : Operation Timed Out ('start-sleep 6')
At line:1 char:1
+ get-runtimeerror -src 'start-sleep 6' -timeout 2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-RuntimeError

* Modify native linux command tests to skip on Windows and pending on Mac

* remove verbose and progress output from help tests

* Be sure that Feature Counter tests only run on Windows

Also, only call add-type in CounterTestHelperFunctions.ps1 if we're going to actually run the tests

* do not run any get-computerinfo tests on non-windows systems

* suppress progress output from PowerShell Get tests

* remove -quiet from API and CRON Builds

Travis watches output from the build to ensure that it hasn't hung
we need to find a balance between too much output and not enough output.
A run which has too much output is killed because it looks like an error loop
A run which has too little output is killed because it looks like a hang

* Remove commented line in Import-Counter.Tests.ps1

Remove extraneous extra line in PowerShellGet.Tests.ps1

* Change `-as "type"` to `-as [type]` in build.psm1

Alter timeout to 10 seconds to be improve chances of not timing out for runtime parser checks
improve logic for counter tests to also skip for IoT

* use the existing function of SkipCounterTests rather than duplicate the logic in import-counter.tests.ps1
2017-01-10 14:42:27 -08:00
Mike Richmond 4eb1494442 Revert "Initial Support for Fedora 24" (#2970) 2017-01-06 13:09:40 -08:00
Naadir Jeewa 8262091b3a Initial Support for Fedora 24 (#2738)
* Initial support for Fedora 24
This commit adds initial support for the Fedora distribution,
starting with Fedora 24.

Whereever possible, build tooling for CentOS has been reused.

Until the next release of PowerShell is compiled against .NET 1.1,
the Docker release image uses the CentOS 7 build, but loads
in the CentOS 7 version of `libicu50` via LD_LIBRARY_PATH.

* Update Dockerfile

Fix typos
2017-01-06 10:04:18 -08:00
2xmax 1ccd155917 fixed some expected exception tests according to the template 611f7f9b77/docs/testing-guidelines/WritingPesterTests.md (L54) 2017-01-05 18:23:37 -08:00
Aditya Patwardhan a0bc987989 Fix test where Export-Alias * fails when only single file exists (#2953)
* Fix test where Export-Alias * fails when only single file exists

The test expects multiple files to be present at the location. We
explicitly create multiple files now under $TestDrive and use that the
location for Export-Alias
Also, so test structure changes.

* Address code review comments
2017-01-05 18:04:42 -08:00
Bryce Milton - MSFT 2b47b58fb0 Updating SHA values in Dockerfiles for Alpha.14 (#2961)
Previously contained Alpha.12 values - Need to find some way of
automating this.  https://github.com/PowerShell/PowerShell/issues/2960
2017-01-05 17:02:10 -08:00
Francisco Gamino 66691a1c0c Adding PlatformNotSupportedException to Counter cmdlets when running on IoT. (#2952)
* Adding PlatformNotSupportedException to *-Counter cmdlets for IoT as pdh.dll is not available.
* Adding tests to validate PlatformNotSupportedException for the Counter cmdlets on IoT.
2017-01-05 16:59:31 -08:00
Aditya Patwardhan 1264eedb42 Code coverage automation script (#2918)
This script downloads the latest nightly build package and executes the
tests on it. It also downloads all necessary tools and then uploads the
results to Coveralls.io. The badge for coverage is posted on README.md
2017-01-05 11:13:22 -08:00
iSazonov 0e2c1c4d9f Fix typo and formating in class basic parser tests 2017-01-05 08:41:34 -08:00
Ilya 124979b4da All test reported as skipped if not applicable to the platform (#2892)
* All test reported as skipped if not applicable to the platform

Fixed files:

powershell\Modules\Microsoft.PowerShell.Management\Clear-EventLog.Tests.ps1:1:if
($IsWindows -and !$IsCoreCLR) {

powershell\Modules\Microsoft.PowerShell.Management\Get-ComputerInfo.Tests.ps1:1325:
return

powershell\Modules\Microsoft.PowerShell.Management\Get-EventLog.Tests.ps1:1:if
($IsWindows -and !$IsCoreCLR) {

powershell\Modules\Microsoft.PowerShell.Management\New-EventLog.Tests.ps1:1:if
($IsWindows -and !$IsCoreCLR) {
powershell\Modules\Microsoft.PowerShell.Management\Registry.Tests.ps1:7:
if ($IsWindows -eq $false) {

powershell\Modules\Microsoft.PowerShell.Management\Registry.Tests.ps1:167:
if ($IsWindows -eq $false) {

powershell\Modules\Microsoft.PowerShell.Management\Remove-EventLog.Tests.ps1:1:if
($IsWindows -and !$IsCoreCLR) {

powershell\Modules\Microsoft.PowerShell.Management\TimeZone.Tests.ps1:17:if
($IsWindows) {

powershell\Modules\Microsoft.PowerShell.Security\FileCatalog.Tests.ps1:6:if
($IsWindows) {

powershell\engine\Help\HelpSystem.Tests.ps1:112: if ($IsWindows)

* Fix test after code review

* Move skiping to common 'try'
2017-01-04 10:09:07 -08:00
David Christian 062e15def2 Add parameter -Group to Get-Verb (#2789) 2017-01-03 15:13:42 -08:00
Dongbo Wang 906c750386 Add release checklist and add '-PSModuleRestore' to 'Start-PSBuild' in a few docs (#2946) 2017-01-03 14:32:54 -08:00
Faheel Ahmad d8b4200f6f Display PM and WS in MB instead of KB (#2927)
Modify output of Get-Process to display PM and WS in MB instead of KB.

Also change precision of CPU time to 2.
2016-12-29 10:49:15 -08:00
Lee303 78aa9a5b56 fix typo in comment (#2938) 2016-12-29 10:46:52 -08:00
Christopher Nelson 7388ec960f build: Update build.sh to run fully manual build (#2832)
* build: Update build.sh to run fully manual build
* add ubuntu-16.10-x64 to the list of architectures to build for.w
2016-12-28 13:59:51 -08:00
Ilya 8daef18769 Fix here string '$a=@"n'"'n"@' (#2913)
The tokenizer did multiple scans the script line to get tokens. Before
the fix the tokenizer on the first pass examined that string as
double-quoted (Expandable) string not as here string, figured the
average double quotation mark as a closing and then starting with the
single quotation mark continued processing the line as single-quoted
string which had no closing single quotation mark.
The fix is to stop the first scan pass after getting '=' (assume
assignment-expression '$a=' for next pass).
2016-12-23 09:34:09 -08:00
Keith Hill cd743cc7b0 Add support for escape char ESC via `e. (#2920)
This change is a breaking change but falls into compat bucket #3 - unlikely grey area.
2016-12-23 09:00:37 -08:00
Charu Bassi 821c965aee Fix type completion w/ type aliases (accelerators) (#2533)
Type completion would behave strangely when there were multiple aliases for a given type (currently only possible with type accelerators).

The fix is to only select the accelerator that matches what the user typed.

Closes #2295
2016-12-21 15:33:05 -08:00
Aditya Patwardhan a09a8cc2dd Update README.md with Code coverage badge
Add the code coverage badge to the nightly build table. The code coverage data is collected on an Azure instance and pushed to Coveralls.io
2016-12-21 10:42:23 -08:00
Manikyam Bavandla 3938cdb33a [Build] Update the logic to remove PSGetModuleInfo.xml from PowerShellGet module on Non-Windows platforms. (#2897) 2016-12-16 22:16:03 -08:00
Jason Shirk 047cfdeaf0 Merge pull request #2893 from PowerShell/v6.0.0-alpha.14
V6.0.0 alpha.14 doc changes
2016-12-15 12:52:33 -08:00
Jason Shirk (POWERSHELL) 1e1903cca7 Correct links for alpha 13->14 2016-12-15 12:25:46 -08:00
Jason Shirk (POWERSHELL) 48b8542ada Update download.sh for v6.0.0-alpha.14 2016-12-15 11:54:31 -08:00
Aditya Patwardhan a06778ca75 Change package name to CodeCoverage.zip from Powershell_6.0.0... (#2886)
Changed the package name from the standard Powershell_6.0.0-xx-gxxxxxxx to
CodeCoverage.zip so that it is easier to download the latest package from
the AppVeyor permalink for last successful build.
2016-12-15 10:35:55 -08:00
Max Maximov 8be31098b1 Invoke-RestMethod cmdlet error if the response is neither JSON nor XML (#2862)
* This change fixes the Invoke-RestMethod cmdlet behavior if the input is neither xml nor json.
* test description
* fixed the failed tests
* removed some duplication
* refactoring: eliminated some double castings
* added JsonObject unit tests; enhanced JSON deserialization exception message
* refactored JsonObject.Tests.ps1
* entitled test cases
* formatting
2016-12-15 00:06:26 -08:00
Jason Shirk (POWERSHELL) cb55171276 Update CHANGELOG.md for v6.0.0-alpha.14 2016-12-14 15:12:00 -08:00
Jason Shirk (POWERSHELL) dd584a817a Update alpha.13 to alpha.14 2016-12-14 15:04:15 -08:00
Hemant Mahawar e26c2a8752 Adding windows server names to the windows packages + Misc formatting fixes (#2757)
* Adding windows server names to the windows packages + Misc formatting fix

Misc fixes are:
- Added Get-PackageSemanticVersion function
- Added New-ZipPackage function to separate the Zip packaging code
- Removed ending ';' in hashtable syntax since entries are on new lines
- Standardized the variable name from $Source to $PackageSourcePath for
various packaging functions
- Removed 'return' in the function end to output the variable value
- Added -verbose to Write-Verbose to show the paths of various packages

* update

* Adding windows server names to the windows packages + Misc formatting fix

Misc fixes are:
- Added Get-PackageSemanticVersion function
- Added New-ZipPackage function to separate the Zip packaging code
- Removed ending ';' in hashtable syntax since entries are on new lines
- Standardized the variable name from $Source to $PackageSourcePath for
various packaging functions
- Removed 'return' in the function end to output the variable value
- Added -verbose to Write-Verbose to show the paths of various packages

* update

* Addressing review feedback

* Removed the $PackageVersion variable per review feedback

* Error message fix
2016-12-14 09:28:38 -08:00
Francisco Gomez Gamino 8bfba04f1e Adding Pester tests for *-Counter cmdlets 2016-12-13 11:00:22 -08:00
Jeff Bienstadt da04f2b1a8 Implement performance-counter cmdlets for Windows CoreCLR
Code changes per PR code review - 3
2016-12-13 11:00:22 -08:00
Adam Bertram e07e1b596d Fixed PowerShell extension broken link (#2874) 2016-12-12 10:17:43 -08:00
Sergei Vorobev cb378be1c8 Create Start-PSRelease helper function (#2753) 2016-12-12 09:34:17 -08:00
Dongbo Wang bbf1766ac7 Fix try/catch to choose the more specific exception handler (#2429)
* Refactor 'FindMatchingHandler' to get rid of recursion
Search state can be saved and used throughout the searching process without the recursion.

* Rank the exception types based on how specific they are

* Refactor code to find handler based on the rank of given handlers
2016-12-09 12:37:08 -08:00
Dongbo Wang c982f30d4e Fix powershell class to use the current EngineSessionState for execution. (#2837)
When a PS class is defined in a module and the module gets reloaded, the class would still use the SessionState from the old module for execution, and thus it doesn't reflect changes to the module state during the reload. This fix is to make sure we always use the current EngineSessionState for PS class execution.
2016-12-09 11:06:07 -08:00
Robin Munn 38977a27ea Fix Unicode in license_thirdparty_proprietary.txt (#2857)
This file contained many occurrences of U+F0A7, a character from the
designated Private Use Area, so its meaning is not defined and fonts
can assign any symbol to that character. Since the person who originally
wrote this file works at Microsoft, it seems reasonable to assume that
he was using the Wingdings font, which has a bullet character at U+F0A7.
Thus, replacing these characters with the proper Unicode bullet (U+2022)
seems the right way to fix this.
2016-12-08 14:58:23 -08:00
Dave Wyatt 177c99de93 Adding ValidateNotNullOrEmpty attribute to parameters listed in #2672 (#2685) 2016-12-08 10:28:55 -08:00
Aditya Patwardhan 49d5b6ab4f Fix OpenCover.console.exe parameter ordering issue. (#2854)
* Fix OpenCover.console.exe parameter ordering issue.

The targetargs parameter needs to be at the end, otherwise everything
after that is considered as part of targetargs.

* Addressed code review comments

* Removed unnecessary file
2016-12-08 09:47:03 -08:00
Naadir Jeewa 32a8601f92 Rebase onto .NET Core 1.1 (#2737)
* Rebase onto .NET Core 1.1

Modify `Build.psm1` and `project.json` files to use .NET Core 1.1.

.NET Core 1.1 ships with an older dotnet/cli than has currently been used,
so we revert to use case-sensitive directory names for dependencies.

.NET Core 1.1 is a pre-requisite for supporting Fedora 24.

* PSReadLine: Bump major version of PSReadline to 6.0.0-*

* Microsoft.PowerShell.Commands.Utility: Bump major version of Microsoft.CodeAnalysis.Csharp

* Microsoft.PowerShell.SDK: Revert attempt to import netcoreapp1.1 instead of dnxcore

* build.psm1: Restore ability to specify version of dotnet-install.sh
2016-12-07 18:29:21 -08:00
Kitt Holland e568fda5c3 Rewrite New-TemporaryFile in C# (#2786)
Literal translation of New-TemporaryFile function to a C# cmdlet,
other than moving logic from Begin to End.
2016-12-06 16:22:07 -08:00