Commit graph

1102 commits

Author SHA1 Message Date
Andrew 1d1cffd0c5 Auto-mounted file system drives correctly created when mounted inside a module (#3034)
Fixes #2442
2017-03-06 16:26:06 -08:00
Staffan Gustafsson b4049879d4 Adding Parent extended property to System.Diagnostics.Process (#2850) 2017-03-06 15:21:39 -08:00
James Truher [MSFT] c6bd000e6d Add additional tests for Clear-Content to improve coverage (#3157)
Coverage has improved to more than 85% for Clear-Content
2017-03-06 13:57:09 -08:00
Lee303 b043b444db adds parameter sets to web cmdlets to allow for standard and non-stan… (#3142)
* adds parameter sets to web cmdlets to allow for standard and non-standard method verbs

* add CoreCLI implementation

* Adds CM alias and notnullempty for CustomMethod parameter

* Add tests for Invoke-[WebRequest|RestMethod] CustomMethod parameter

* Fix webcmdlet tests - incorrect parameter name
2017-03-06 11:41:14 -08:00
Steve Lee a2687bfb59 Allow profile directory creation failures for Service Account scenarios (#3244)
XDG profile directory creation can fail for accounts that do not have home directories.

The module analysis was trying to persist it's cache in an XDG profile directory.
The cache is less critical than it once was, so it's reasonable to not cache if there is no good place to do so.

Fixes #3011
2017-03-05 22:05:10 -08:00
PetSerAl c490e36a58 Remove System.Array type data (#3231)
* Rename Types_Ps1Xml.generated.cs
* Remove <auto-generated> header from Types_Ps1Xml.cs
* Remove System.Array type data
* Update `Get-TypeData` tests
2017-03-01 12:58:03 -08:00
Dongbo Wang fc30ae1d87 Port CmsMessage cmdlets and Get-PfxCertificate to powershell core (#3224) 2017-03-01 10:51:19 -08:00
Steve Lee 99d696f31f Fix Test-Modulemanifest to normalize paths correctly before validating (#3097)
Changed hard coded Windows directory separator and resolved path so the slashes are correct.
Throw if resolving file path returns more than one result

Fixes #2610
2017-03-01 10:36:02 -08:00
Paul Higinbotham b4cb5e95a2 Implementation for Invoke-Command step-in remote debugging (#3015)
These changes provide the ability to debug remote running scripts started with the Invoke-Command cmdlet. The design is event based and provides new public events that allow subscribers to be notified when an Invoke-Command remote session is ready for debugging. Since Invoke-Command allows running scripts on multiple targets at once (fan-out) the notification event is raised for each remote session as it becomes ready for debugging. The subscriber to these events will be a script debugger implementation (such as PowerShell console, ISE, or VSCode) and will handle all debugging details such as simultaneously debugging multiple remote sessions at once in separate windows.

But these changes also include an internal implementation which is used by default if host debuggers don't want to handle the debugging details. This internal implementation is what PowerShell console, ISE uses so they can have this new behavior without having to modify their debugger implementations. The internal implementation serializes each remote session of Invoke-Command so that they can be debugged one at a time. The remote session debugger is "pushed" onto the internal debugger stack so that debugging transitions to the remote session. Existing debugging commands work so that the "quit" debugging command will stop the current remote session script from running and allow the next remote session to be debugged. Similarly the "continue" debugging command allows the script to continue running outside step mode and again go to the next remote session for debugging. The "stepout" debugging command steps out of all Invoke-Command remote sessions and lets the script continue to run for each remote session in parallel as they are normally run.

The purpose of Invoke-Command step-in remote debugging is allow seamless debugging of a local script that calls Invoke-Command on remote targets. But there is also a new Invoke-Command "-RemoteDebug" parameter that lets you Invoke-Command on the command line and have it drop directly into the debugger.

An example from the PowerShell command line looks like this:
```
PS C:\> C:\TestICM.ps1
Entering debug mode. Use h or ? for help.

Hit Command breakpoint on 'Invoke-Command'

At C:\TestICM.ps1:2 char:1
+ Invoke-Command -cn $computerName,paulhig-3 -File c:\LinuxScript.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[DBG]: PS C:\>> list

    1:  $computerName = "localhost"
    2:* Invoke-Command -cn $computerName,paulhig-3 -File c:\LinuxScript.ps1
    3:  "Test Complete!"

[DBG]: PS C:\>> stepin
At line:1 char:1
+ Write-Output "Running script on Linux!"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[paulhig-3]:[DBG]: [Process:14072]: [Runspace5]: PS C:\Users\paulhi\Documents>
```

Notice that the debugger "stepin" command transitioned from local script debugging to debugging the remote session on computer "paulhig-3", as can be seen by the change in the debugger prompt.

You can also do this from the command line to drop directly into the debugger
```
Invoke-Command -cn localhost -Script  $scriptblock -RemoteDebug
```

These changes also remove an old behavior that was incompatible with this new step-in feature. Previously if a remote session running script hit a break point it would stop in the debugger and go to the "disconnected session" state. This was to allow the user to reconnect using Enter-PSSession and then interactively debug the remote session script. This behavior has been removed and now the user needs to attach a debugger using the newer Debug-Runspace cmdlet.
2017-03-01 10:28:25 -08:00
PetSerAl ae37a9fafe Fix powershell to not crash on converting recursive array to bool (#3208) 2017-02-27 10:54:07 -08:00
Staffan Gustafsson e3b59e0f51 Moving Import-PowerShellDatafile from script to cmdlet (#2750) 2017-02-26 16:50:28 -08:00
Steve Lee c74b2a7670 return HTTP response for error status as part of exception (#3201) 2017-02-24 22:29:11 -08:00
Kitt Holland d69193e49c Prettier formatting for ConvertTo-Json output. #2736 (#2787)
* Prettier formatting for ConvertTo-Json output. #2736

This change standardizes JSON output to example given, as well as
codemaid and online lint tools.

Sample object used for testing:

@{
foo = @{
first = 'a'
second = 'bbbbbbbb'
}
barbarbarbar = @{
first = 'a'
second = 'bbbbbbbb'
NestedArray = @(
'Test3'
'Test4'
'Test5'
3
4
)
NestedObject = @{
MoreObject = 'AnotherObject'
TestBool = $true
}
}
array = @(
'Thing1'
'Thing2'
)
dan = 15
} | ConvertTo-Json

* Updated CoreCLR implementation to use NewtonSoft Indented Formatting

I did not change the FullCLR behavior, I was not sure if you meant to
revert my changes or to leave it as is in the current pull request.

* Added tests that validate pretty Json output.

Not sure if there is a better thought on how to implement these. The
first two fail against current master, but succeed once this PR is
applied. Third test is successful prior and post this PR.

* Moved tests and removed extraneous file.

Moved pretty/compressed json tests from standalone file into the
existing ConvertTo-Json test file.

* Updated tests for cross-platform support
2017-02-24 14:40:11 -08:00
Dongbo Wang 8b8d20d56b Work around the hang issue that happens when running class basic parsing tests (#3191) 2017-02-23 13:05:09 -08:00
James Truher [MSFT] 9e27f4a64c Implement -version parameter in console host (address part of https:/… (#3115)
* Implement -version parameter in console host (address part of https://github.com/PowerShell/PowerShell/issues/1084)

This does not support providing a specific version to run, but
like most other *nix commands, -version will now return the version
of the PowerShell Engine. 'powershell' is prepended to the output to
match other *nix commands. We are using gitcommitid which includes more
info about the build.
2017-02-23 09:36:50 -08:00
Dongbo Wang 16ff1978e1 Fix casting single element array to generic collection (#3170) 2017-02-22 23:10:06 -08:00
jeffbi a557c03570 Provide additional tests for the *-Job cmdlets (#3110) 2017-02-22 08:46:27 -08:00
Ilya e10cbff354 Add ShouldProcess to New-FileCatalog and Test-FileCatalog (#3074)
* Add ShouldProcess to New-FileCatalog and Test-FileCatalog

Close #3068

Add support `-WhatIf` and `-Confirm` to `New-FileCatalog` and add a
test.
`Test-FileCatalog` has a common code base with `New-FileCatalog` so it
automatically get the same. I believe that adding a separate test in
this case doesn't make sense.

* Fiz after code review

Remove  _ShouldProcess
Add var in test
2017-02-17 16:32:58 -08:00
Ilya 88c8be75f2 Get-ComputerInfo - fix typo in property name (#3167) 2017-02-17 13:10:51 -08:00
Dongbo Wang 5a8fa57278 Fix PSModuleInfo.CaptureLocals to not do ValidateAttribute check when capturing variables from the caller's scope (#3149)
Fix PSModuleInfo.CaptureLocals to not do ValidateAttribute check when capturing variables from the caller's scope
2017-02-16 21:25:23 -08:00
Paul Higinbotham c266c8ebca Fix for duplicate types in TypeTable (#3141)
When a TypeTable is created it includes the types from type files provided along with references to the type files. When the InitialSessionState (ISS) object processes these types it reads the type files again and ends up with duplicate type entries. PowerShell V5.1 ISS type processing was re-written to improve performance and no longer removes duplicate types, so that this scenario (runspace ISS reuse) results in errors causing a regression.

The fix is to copy only type data when a TypeTable is passed to the ISS.
2017-02-16 16:28:29 -08:00
Ilya 409ab7443f Fix GetType() bad pattern and related issues in tests (#3134)
* Fix GetType() bad pattern and related issues in tests

$var.GetType() can raise an exception in tests so we should check $var
before make the call. A large part of the tests does not make this
check.
I start with searching ".GetType()" but discovered many related issues
in tests (reduntant and unneeded tests, "throw" bad pattens, bugs,
formattings (sorry!) and so on) - I had to fix them too.

* Fix after code review
* Second wave of migration GetType() -> BeOfType
Removed 'GetType().Name' patterns.
2017-02-15 16:40:51 -08:00
James Truher [MSFT] d801b75d35 Remove async tests for parser (#3119)
* Remove async tests for parser
this is a fix for https://github.com/PowerShell/PowerShell/issues/3069
This removes an attempt to work-around the issue of tests hanging on Travis-CI.
* remove unneeded finally block
2017-02-15 16:39:30 -08:00
Ilya fd70adbc90 Improve console cmdlets tests (#3101)
* Improve console cmdlets tests
Main improvements refer to tests of the Write-Host cmdlet.
Original tests:
1. Slow because run external processes
2. Don't test colors and -NoNewLine in fact.

1. The original tests is preserved (deleted one as redundant) but marked
by 'Slow' tag. They is preserved because they actually check the output
on the work, not a test console.
2. Add negative color tests. (Code cover grow!)
3. Add tests based on TestHostCS. This test host has been refined so we
can see colors and a new line in output.
4. Add minor fixes for test modules loads.

Also I add support for Information stream. I originally planned to use
it but not actually used. However, I have left this as a useful addition
for future tests.
I wonder that a Write-Host console output is duplicated in Information
Stream - Is it by design? I left a debug print on this matter in the
test code.

* Fix after code review
* Corrections after code review
Suppress import-module warnings
Rename Describes
Add "-Object" test
Add Stream.Information tests with TestHostCS
* Add checks for Streams.Information and add comments
2017-02-14 11:00:03 -08:00
Paul Higinbotham ca12001c8d Implement RoleDefinitions RoleCapabilityFiles keyword (#3067)
* Changes to implement remote endpoint RoleDefinition RoleCapabilityFiles keyword
* Fixed spelling error.  Added back missing resource string
* Updated tests from CR comments
* Simplified error tests per Code Review
* Test change from Code Review
2017-02-14 10:42:17 -08:00
Ilya a16fead0a5 Fix error position reporting on classes (#3103)
Interactive hosts expect an `IncompleteParseException` to signal that more input is expected.

When detecting errors, the parser can report 2 positions:
* where the error should be reported
* where the error was detected

Typically these are the same, so most error reporting methods have a single parameter.
For missing braces, the pattern is supposed to be to report the error after the opening brace, but the error is typically detected at the end of the file.

There were a few places where we were not consistent in reporting such errors, this PR corrects those places.
2017-02-13 16:45:00 -08:00
Andrew Gaspar ca5fc9c5a8 Fix tab completion of native parameters (#2919)
Native argument completers were not invoked when the argument was a single dash.

The fix is to treat unbound command parameters as command arguments for the purposes of parameter/argument completion.
2017-02-13 16:02:56 -08:00
Ilya aa764dd54e Small typo in archive cmdlets tests (#3121)
* Small typo in archive cmdlets tests
* Add  -ErrorAction SilentlyContinue
2017-02-10 13:39:34 -08:00
Ilya b22369e2be Make small optimization in parser tests (#3072)
* Make small optimization in parser tests

* Add Clear() for common command
Remove commands from AfterEach

* Refactoring test 'functions are resolved before cmdlets'
2017-02-08 17:42:44 -08:00
James Truher [MSFT] 5871e1ac4b Provide class level coverage data via OpenCover module (#3088) 2017-02-06 23:04:45 -08:00
Ilya 29818062e8 Convert Get-FileHash to a cmdlet (#3024) 2017-02-03 18:11:57 -08:00
Sergei Vorobev 8517b8dafb Mark Write-Information test as pending on macOS 2017-02-03 09:27:35 -08:00
Francisco Gamino f57f924caf Adding '$pshome/cultureName/default.help.txt' to PowerShell Windows Core project. (#3032)
* Adding PowerShellHelpFiles package which contains default.help.txt to powershell-win-core

* Adding test case to validate that <pshome>/<culture>/default.help.txt is present. This is done by calling 'Get-Help'

* Updating get-help to skip searching for the help file when the InternalTestHooks.BypassOnlineHelpRetrieval is enable. This way, we force get-help to generate a metadata driven help object, which includes a helpUri that points to the fwlink defined in the cmdlet code.

* Updating get-help -online <cmdletName> tests to not delete the help files. Instead, I've added logic to get-help to not find the help file when the test hook BypassOnlineHelpRetrieval is enable.
2017-02-01 17:56:52 -08:00
Sergei Vorobev 9750297ce3 Add 'osx.10.12-x64' runtime to project.json files 2017-02-01 17:52:35 -08:00
Aditya Patwardhan a69116db05 Fix GetComputerInfo test for looking up registry (#3065)
* Fix GetComputerInfo test for looking up registry

* Addressed code review comments
2017-02-01 17:49:33 -08:00
Aditya Patwardhan 8303a2b3fb Fix get-help online test (#3051)
Fix the "get-help -online" test using a workaround so that when a default browser is not set, the test does not fail.
2017-02-01 17:19:55 -08:00
Aditya Patwardhan 9ab8c6df4c Make OpenCover merge and upload more reliable/usable (#3078)
* Corrected the opencover option to merge the output file

- Delete temporary zip file.
- Remove CodeCov uploading through cygwin.
- Add code to use Invoke-WebRequest to upload to CodeCov

* Codecov settings

- Wait for 1 build to start analysis.
- Do not wait for CI.
- Disable comments in PR.

* Addressed code review comments
2017-02-01 15:45:03 -08:00
Francisco Gamino 89a5c17d6b Fixing 'InFile parameter of Invoke-WebRequest doesn't work' and adding aliases (iwr for invoke-webrequest and irm for invoke-restmethod) to the web cmdlets. (#2848)
* Fixing Invoke-WebRequest InFile parameter

* Adding aliases for Invoke-RestMethod and Invoke-WebRequest

* Adding test cases for Web cmdlets -InFile parameter

* Adding tests for Invoke-WebRequest (iwr) and Invoke-RestMethod (irm) using the cmdlet aliases.

* Remove the extra leading space
2017-02-01 10:14:24 -08:00
Aditya Patwardhan d7cf81b64d Added functionality to improve failure triaging (#3037)
* Added functionality to improve failure triaging

- Nunit logs will be created to tests.
- Logs are copied to the Azure share.
- Pester is run with -Quiet
- Elevated and unelevated runs for tests with appropriate tags

* Copy logs to Azure share and upload to CodeCov

- Zip and copy to Azure log share
- Upload to codecov using cygwin

* Fixed varaible name in if condition

* Addressed code review comments

* Modified the destination folder structure for logs

- Creates a folder structure for yyyy-MM and Windows for storing logs
- Updated zip file name to not have illegal characters

* Modifications as suggested by codecov.io
2017-01-27 09:40:18 -08:00
Noutlaw1 edf685dc9c Added alias (Path) to the FilePath parameter of the Out-File cmdlet. (#2945)
* Added parameter alias to the Out-File cmdlet, allowing -FilePath to be used as -Path.

Relevant issue: https://github.com/PowerShell/PowerShell/issues/2923

* Test to confirm the alias I added to the Out-File cmdlet's -FilePath parameter works.

* Changed test for parameter alias as per feedback.

* Updating based on feedback.

Made formatting changes:
Added space between brackets and start of cmdlet.
Moved end bracket to before the pipe and Should Not Throw statement.
Removed -InputObject parameter for the test, as it was not needed.

* Added BeforeAll to the first part of the file. Replaced tabs with spaces.

#2945

* Fixing indentation within the test file
2017-01-26 14:17:40 -08:00
Ilya abc3614919 Get-Help test reported as skipped if not applicable to the platform (#3009)
Addressed #2887
2017-01-24 18:04:44 -08:00
Mike Richmond f2b9f7d5ab Add WindowsUBR to Get-ComputerInfo (#2995) 2017-01-23 13:07:38 -08:00
Ilya cba1c26bf0 Fix typo in Unblock-File test (#3025) 2017-01-23 11:43:38 -08:00
Naadir Jeewa 01dfb88e4d 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-20 11:05:24 -08:00
iSazonov f0a95814d5 Add Unblock-File tests 2017-01-17 17:08:29 -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
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
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
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
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
Francisco Gomez Gamino 8bfba04f1e Adding Pester tests for *-Counter cmdlets 2016-12-13 11:00:22 -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
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
James Truher [MSFT] 9aa693dfb3 Jameswtruher/travisdaily2 (#2842)
* Assign $ProgressPreference = "SilentlyContinue" to reduce output size

Travis is still complaining that the log file is too big, eliminating progress is
another step to reducing output. It's also not needed for our CI environment.

* Removed white space at end of lines

* fix misplacement of progress preference setting

also fix up trailing whitespace
2016-12-06 13:58:57 -08:00
Dongbo Wang 2fe10558a2 Add basic test to make sure 'New-PSSession' doesn't crash powershell 2016-12-06 11:33:07 -08:00
David Christian 9c9b56d22f Updated Split-Path to work with UNC Roots (#2788) 2016-12-04 15:00:32 -08:00
Aditya Patwardhan 9a195f44c1 Marked flaky test as pending to unblock daily builds (#2838) 2016-12-04 00:12:51 -08:00
iSazonov 8abb6c3a94 Implicitly convert value assigned to XML property to string (#2678)
Using LanguagePrimitives.ConvertTo (to emulate what would happen if the property were a regular .Net property typed as string), we now convert the value assigned to an XML property to string.
2016-12-02 15:43:10 -08:00
Aditya Patwardhan fbb5c16eb9 Disable help content test for Microsoft.Powershell.Archive module (#2835)
The published help content filename is missing '.psm1', but the help still
works. The bug is in PlatyPS and needs to be fixed to re-enable this test.
2016-12-02 15:32:03 -08:00
Paul Higinbotham d2bf6294ab SSH remoting cmdlet parameter set changes based on RFC 0010 (#2710)
* RFC 0010 SSH remoting cmdlet updates.

* Tweaks to SSH remoting cmdlets

* SSHTransport parameter is now optional instead of mandatory.  Aded fix for CoreCLR entry point when hosted in SSH as a subsystem.

* Added tests

* Code review feedback

* Code review comment changes

* Making SSHTransport switch parameter mandatory because otherwise existing Invoke-Command parameter set

* The new SSH parameter set was causing legacy positional based parameters to no longer work. This fix separates the SSH parameter sets from the existing WinRM parameter sets.

* Fixed region name spelling error.
2016-12-02 14:01:08 -08:00
Aditya Patwardhan d9d97a43ca Add ErrorAction Stop so DeviceGuard function (#2825)
A non-terminating error is thrown when the namespace does not exist by
Get-CimInstance. The namespace is not present on OS versions below Windows
10. It is not caught in the try-catch unless ErrorAction Stop is added.
2016-12-02 11:16:11 -08:00
Dongbo Wang e9fdf8e842 Temporarily disable Update-Help and Save-Help tests in CI builds
Also fix a flaky Start-Sleep test
2016-11-30 13:02:32 -08:00
Aditya Patwardhan dcce8a21af Added -erroraction silentlycontinue for import-module (#2778)
If the module is not available it throws an error. To make sure OpenCover
works on PSv4 and below, -erroraction silentlycontinue was added.
2016-11-23 17:41:24 -08:00
Steve Lee 3d94e35f21 updated error messages to tell user what to do (#2766) 2016-11-23 11:50:18 -08:00
Manikyam Bavandla 67e9bf6376 - Fixed failing PackageManagement related tests in daily-builds (#2759)
- Updated Restore-PSModule function to delete the PSGetModuleInfo.xml so that this file will not be included in the PowerShell release.
- Since PackageManagement module gets installed with PowerShellGet module, removed PackageManagement module name in Restore-PSModule command invocation.
2016-11-21 17:36:51 -08:00
Dongbo Wang 20a0ba041c Fix the indicator for redirecting standard input (#2749) 2016-11-21 16:02:52 -08:00
Jianyun Tao bfe59b3495 # This is a combination of 3 commits.
# The first commit's message is:

Changed to PSModuleRestore switch, i.e., by default no PSModule install

# This is the commit message #2:

install PowerShell modules to publish folder as well as one level up

# This is the commit message #3:

removed workaround
2016-11-19 23:52:16 -08:00
Jianyun Tao 00d5f9c884 remove packagemanagement test code 2016-11-19 23:52:16 -08:00
Jianyun Tao a61f70f2e7 Add PackageManagement acceptance test cases 2016-11-19 23:52:16 -08:00
Mike Richmond e23b0b2002 Add runtime win7-x86 2016-11-18 16:35:16 -08:00
Steve Lee 9e9dbeaa5a updates to opencover module to make it more user friendly and works on coreclr (#2702)
* added type to returned objects
replaced expand-ziparchive with call to Archive module
added defaults to location of opencover.xml, opencover installation, powershell.exe, and location of tests
updated error messages with corrective action
replaced System.Net.WebClient call (not available on coreclr) with invoke-webrequest
scoped change of executionpolicy to process when starting pester to avoid error if system policy is less restrictive
updated version of module

* addressing code review feedback
- check for git before using
- check for opencover.console in path
- fixed path to code coverage build of PS

* added Expand-ZipArchive back to support psv4 scenario
2016-11-18 15:03:59 -08:00
iSazonov 4edde10fda Now Enum values definition have space-insensitive syntax (#2690)
Fix to support whitespace after the `=` and before the value expression.
2016-11-18 14:00:26 -08:00
iSazonov 469924d855 Add support W3C Extended Log File Format in Import-Csv (#2482)
* Add support W3C Extended Log File Format

1. Add support W3C Extended Log File Format
2. Refactoring Import-Csv tests

3. Add #Type tests

* Fx test after review

* Fix tests after review

* Remove unneeded test
2016-11-17 16:29:04 -08:00
James Truher [MSFT] 3f99de5784 Added tests to close code coverage in CIM area (#2528)
* Added tests to close code coverage in CIM area

Added CimAdapter.Tests for adaptation layer (code cribbed from BVT tests)
Added SessionOption.Tests.ps1 (Code cribbed from BVT tests)
Modified CimClass tests by adding more tests
Added CimSession.Tests for basic tests of New-CimSession cmdlet
Added CimInstance.Tests for basic tests of Get-CimInstance

* Add CI tags to tests

* unify test execution to use try/catch for marking tests as skipped

moved test which retrieves cimclass via method to feature as it is not
a common operation, this test can take some time as well
2016-11-17 11:46:07 -08:00
Sergei Vorobev ce26bca8db Re-enable Add-Type coreclr tests (#2705) 2016-11-16 21:23:57 -08:00
Dongbo Wang 7e581be7c4 Add HelpUri for Get-Uptime (#2688)
* Add HelpUri for Get-Uptime

* Update online help test data to include Get-Uptime
2016-11-16 11:13:09 -08:00
iSazonov 47be2c372a Write-Information accept objects from the pipeline (#2680)
* Write-Information accept objects from the pipeline

* Add test

* Fix test

Remove unneeded runspace.

* Clear streams before each test case

Streams of the PowerShell instance might have records from other test runs. Clear the streams before each test case.
2016-11-15 22:41:34 -08:00
Sergei Vorobev 32837f06ee Trying to make 'native command lifecycle' test unflaky
Also move it to the Feature category
2016-11-15 14:49:39 -08:00
Sergei Vorobev 616c15556f Re-shuffle minishell tests 2016-11-15 14:49:39 -08:00
Sergei Vorobev f0a4a7d821 Replace spin-lock by a proper BlockingCollection in NativeCommandProcessor 2016-11-15 14:49:39 -08:00
Sergei Vorobev a6fc5387c2 Add a code to handle finished process correctly on Unix 2016-11-15 14:49:39 -08:00
Sergei Vorobev 9658e62682 Add a test for broken linux pipe in native pipeline 2016-11-15 14:49:39 -08:00
Sergei Vorobev 584aec7c92 Add motivation example for the native pipeline changes 2016-11-15 14:49:39 -08:00
Sergei Vorobev 6acc1e0629 Add error stream and information stream tests
for native pipes
2016-11-15 14:49:39 -08:00
Sergei Vorobev a05fffd9dc Add a minishell clixml tests 2016-11-15 14:49:39 -08:00
Jason Shirk (POWERSHELL) ca2dce3537 Improve coverage for Write-Information output 2016-11-14 14:03:30 -08:00
Jason Shirk (POWERSHELL) acdf1c1d44 Fix LengthInBufferCells test for downlevel
When running on systems that do not support a virtual terminal,
the tests was incorrectly assuming escape sequences were removed.

The fix is to expect different results depending on whether or not
the host supports virtual terminal mode.
2016-11-14 13:59:43 -08:00
nmbradford 25005a0ba0 Fix WebRequest failure to handle missing ContentType in response header (#2666)
If a response to invoke-webrequest does not set the content type in the
response header, an object not set exception is thrown in
WebResponseHelper.CoreClr.cs.  Updated to set contenttype = null.
2016-11-14 13:35:07 -08:00
Jason Shirk bd9e49d8d9 Make Out-Null fast (#2629)
People use Out-Null despite much faster alternatives:

    $null = Do-Stuff
    [void] = Do-Stuff
    Do-Stuff > $null

This change makes Out-Null work in roughly the same say as the above.

The optimization is to detect that we're calling the built-in Out-Null
cmdlet when invoking a pipeline from script (the change won't have any
effect in the PowerShell api). If we detect Out-Null, we rewrite the
pipe to look similar to `Do-Stuff > $null`.
2016-11-11 11:29:53 -08:00
Aditya Patwardhan b18adb85d4 Add OpenCover PS Module to collect code coverage (#2585)
* Add OpenCover PS Module to collect code coverage

OpenCover PS Module helps is collecting Code Coverage using the OpenCover
toolset. The module helps in comparing two code coverage runs as well.

* Change OpenCover.psd1 to ASCII

* Fix an error in path for OpenCover

Fixed an error on path for OpenCover. Also used ZipFile class instead of
cmdlet as it might not be available on CI system.

* Convert module to be Powershell v4 compliant

Changed implementation from classes to PSObjects and implemented
Expand-ZipArchive.

* Added CodeCoverage as a configuration to project.json files

Added CodeCoverage as the new configuration for all the project.json
files. When Start-PSBuild is executed with configuration as CodeCoverage,
we change the degubType to 'full' as required by OpenCover toolset.

Also made changes to appveyor.psm1 to build a CodeCoverage package on
daily builds and publish it as a zip.

* Addressed code review comments

Changed from Add-Member to use pscustomobject type accelator. Removed
[gc]::collect.

* Added explicit garbage collection

* Addressed code review comments

- Make sure that the build Start-PSPackage gets is not a code coverage
  build
- Add debugType = full for FullCLR
- Remove configurations from PackageManagement files as it is not needed.
- Build CodeCoverage build first in AppVeyor.

* Resolve merge conflict

* Fix indentation

* Fix newline at end of file

* Added command discovery for locating OpenCover.console.exe
2016-11-11 11:12:07 -08:00
iSazonov b56bbeabc6 Add Get-Uptime to Microsoft.PowerShell.Utility (C# cmdlet) (#2517)
* Add Get-Uptime (C# code)

1. Add Get-Uptime cmdlet (C# code)
2. Modify psd1 files
3. Add tests

* Remove Pretty parameter after Powershell committee conclusion

1. Remove Pretty parameter
2. Remove tests for Pretty
3. Add Throw if  IsHighResolution is False
4. Fix formatting

* Add test to check throw

1. Add hook that simulate 'System.Diagnostics.Stopwatch.IsHighResolution == false' to test Get-Uptime throw
2. Add test to check throw

* Fixes after review

1. Remove Timespan parameter
2. Remove unneeded tests
3. Fix localization
4. Add string consts
5. Fix throw

* Fix OutputType to add parameter set name information
2016-11-10 09:51:29 -08:00
Nana Lakshmanan 2077e42b52 Fixing background jobs for Unix and Windows (#1972) 2016-11-09 22:44:39 -08:00
Lincoln Atkinson 594fae475b Wire up proper ConsoleHostRawUserInterface.LengthInBufferCells for Unix (#2637)
* Wire up proper ConsoleHostRawUserInterface.LengthInBufferCells for Unix

Ref https://github.com/PowerShell/PowerShell/issues/2502
This allows for Unix console host to properly calculate display width for
strings containing escape sequences (e.g. ANSI color), rather than
falling back to naive string.Length.

* Add basic tests for host LengthInBufferCells calculation
2016-11-09 10:20:31 -08:00
Adam Bertram 35b844a756 Fixed broken link in README (#2643) 2016-11-08 10:22:26 -08:00
Steve Lee ae7b857c23 removed Handles column from Process formatter (#2617)
addressing #1812
2016-11-07 10:39:19 -08:00
Francisco Gomez Gamino 92b0eb336d Adding tests for update/save-help, and fixing existing help tests for
Linux.
2016-11-04 16:39:57 -07:00
Kirk Munro 244827a4aa Added -Top/-Bottom params to Sort-Object for Top/Bottom N sort and many Pester tests (#2518)
* Added -Top/-Bottom params to Sort-Object for Top/Bottom N sorts; added many Pester tests

* updated changelog

* updated CHANGELOG.md

* replaced Get-Service with Get-Alias in Pester tests

* improved performance for -unique -top/-bottom, changed according to PR feedback

* added newlines to end of two files

* Removed whitespace changes

* Missed 2 whitespace changes to undo in last commit

* Updated to try to resolve merge issue

* change heapify return type, cleaned up test code

* unique top/bottom N sorts are now 2-3 times faster

* code cleanup (removed unused vars, simplified logic)
2016-11-04 14:09:48 -07:00
Florian Feldhaus 9ccd778ed6 Enable WebRequestPSCmdlet to not validate HTTPS certificates (#2006)
* Enable WebRequestPSCmdlet to not validate HTTPS certificates

Added switch parameter IgnoreCertificateCheck to WebRequestPSCmdlet to enable Invoke-WebRequest and Invoke-RestMethod to not validate the HTTPS certificate of the server if required.

* Changed IgnoreCertificateCheck parameter name to NoCertificateCheck

Changed the switch parameter IgnoreCertificateCheck to NoCertificateCheck for WebRequestPSCmdlet to enable Invoke-WebRequest and Invoke-RestMethod.

* Changed NoCertificateCheck parameter name to SkipCertificateCheck

Changed the switch parameter NoCertificateCheck to SkipCertificateCheck for WebRequestPSCmdlet to enable Invoke-WebRequest and Invoke-RestMethod.

* Added test for SkipCertificateCheck parameter

Validation of SkipCertificateCheck parameter in Invoke-WebRequest and Invoke-RestMethod. First validating, that exception is thrown for HTTPS URI with expired certificate. Then validating, that no exception is thrown if SkipCertificateCheck parameter is used. HEAD method must be used for Invoke-RestMethod to not return any body. Invoke-RestMethod can't parse the HTML returned when using GET method.

* Updated test for SkipCertificateCheck parameter to use ExecuteWebCommand function
2016-11-03 14:29:17 -07:00
Jason Shirk c8c55b7ce7 Fix NullReferenceException in binder (#2591)
There was a NullReferenceException after turning on constrained language mode
if creating a binding on a thread with no runspace.

The fix is to assume if there is no runspace that we are not in constrained language
mode, and also generate a binding restriction that assumes the same.
2016-11-03 14:15:58 -07:00
Charu Bassi 85825e2b0b Fix Resolve-Path -LiteralPath for drive paths (#2572)
Resolving #2570.
Ignore drive paths in the check. If the input is a drive path,
then "\" is passed as the path to GetDriveQualifiedPath with drive info.
Since, the path here starts with "\", treatAsRelative is set to false
which prevents further formatting of this path.
The check is only valid for PSDrives with root path equals to UNC paths or the paths
in unix.
2016-11-01 18:01:52 -07:00
Jason Shirk b7c04df47b Update NativeCommandProcessor.Tests.ps1
Fix logic error in skipping
2016-11-01 14:15:31 -07:00
Jason Shirk (POWERSHELL) 9b20875d6f Test that pipeline isn't blocked when running windows exes 2016-11-01 14:15:31 -07:00
Steve Lee 1851e1a5dc fixed test on Windows, also should have been pending due to another bug (#2580) 2016-11-01 10:53:19 -07:00
iSazonov 5aee4ba85e Fix Select-Object to approve UX and fix return a property named * (#2421)
There are mainly 2 changes:
1. When '-ExcludeProperty' is specified but '-Property' is not, use "*" as the default value for '-Property'.
2. Allow 'Select-Object -Property noexist-name' to return a PSObject with property noexist-name, unless noexist-name itself contains wildcards.
2016-11-01 10:04:44 -07:00
iSazonov cef0c54157 Fix Get-Alias Name parameter allows Null value (#2545)
1. Add [ValidateNotNullOrEmpty()] to Name parameter
2. Add tests
2016-10-31 17:19:25 -07:00
Steve Lee 44eb20dc8f Fixes #2534 by replacing expensive WMI query with Win32 API calls (#2535)
* Fixes #2534 by replacing expensive WMI query with Win32 API calls

* fix break on unix build

* added tests for #2535

* although test passed, fixing exception that shows up

* fixed Describe text

* addressing code review feedback

* addressing review feedback to comment on why sleep is needed
added check that test processes are created before we try to kill them

* fixed test to timeout and pending fix for #2561
2016-10-31 09:41:13 -07:00
Dongbo Wang 0e8c809ffb Replace 'git rev-parse' with path relative to '$PSScriptRoot' in powershell tests 2016-10-28 16:51:44 -07:00
Dongbo Wang e09ddc494c Further update the tests and product code to fix test failures 2016-10-28 16:51:44 -07:00
Dongbo Wang 4bb0b13e09 Refactor implicit remoting tests to work in CI 2016-10-28 16:51:44 -07:00
PowerShell Team c975b9f6a0 Move implicit remoting tests from source depot to GitHub 2016-10-28 16:51:44 -07:00
Charu Bassi ee2feaa827 Fix set-content failure for creating file in psdrive. (#2392)
Resolving #2206

Set-Content fails to create a file for PSDrive path, if the path root
begins with defaultPathSeperatorString (ex: UNC path and paths in Single
rooted filesystems like Unix)
2016-10-28 14:31:02 -07:00
Hemant Mahawar 67638548fc Add ValidateNullOrEmpty to -Name parameter of Get-Service (#2542)
* Adding validation to Get-Service -Name parameter
2016-10-27 16:37:50 -07:00
iSazonov baeec066d9 Add support <Suppress> in Get-WinEvent -FilterHashtable (#2506)
* Add support <Suppress> in Get-WinEvent -FilterHashtable

1. Add support <Suppress>
2. Refacrtoring BuildStructuredQueryFromHashTable() to use StringBuilder
3. Add tests

* Changelog
2016-10-27 14:54:14 -07:00
Dongbo Wang 9ec8baea79 Add '<Link>' tag to '<Compile>', '<None>' and '<EmbeddedResource>' tags to make those items look similar as when the *.csproj files were in the original project folders. (#2519) 2016-10-21 17:04:05 -07:00
Dongbo Wang 9818988e33 Update the .csproj files to point to the correct items (e.g. *.cs and *.resx) 2016-10-21 14:12:10 -07:00
Dongbo Wang 54cb65bbf2 Move *.csproj files to PowerShell/src/vs-csproj and PowerShell/test/vs-csproj to avoid confusing the latest dotnet.exe.
If a *.csproj file is in a project directory, the latest dotnet.exe will use it, instead of the project.json file, to build the project.
2016-10-21 14:12:10 -07:00
PowerShell Team ed38d70cf6 Adding Ported Get-ComputerInfo Tests 2016-10-19 14:59:38 -07:00
Andrew Schwartzmeyer e630c6f79c Fix GetCurrentThreadId 2016-10-14 15:43:00 -07:00
Andrew Schwartzmeyer 24d0ce36e6 Fix SetDate
And use a bunch of unsafe code because of concerns about stack size.
2016-10-14 15:43:00 -07:00
Andrew Schwartzmeyer 0ce5575f57 Clean up CreateSymLink 2016-10-14 15:42:58 -07:00
Dongbo Wang e240c0cb32 Make Pester skip the redirection test for '[Encoding]::Default' instead of ignoring it, so that we can keep track of this encoding issue 2016-10-14 10:02:44 -07:00
Dongbo Wang 139b399223 Fix test failures due to changes in .NET Core and the exclusion of 'Certificate' provider in UNIX PS 2016-10-14 10:02:44 -07:00
Dongbo Wang 2e402cfef1 Update powershell to depend on latest dotnet core packages (preview1-24530-04 from 9/30/2016) 2016-10-14 10:02:44 -07:00
Christopher Ubben c0f1d85e99 Added feature level test coverage to Registry provider (#2417) 2016-10-12 14:58:22 -07:00
iSazonov 6a62969f77 Add Invoke-Item deterministic Windows tests (#2443)
* Add Invoke-Item deterministic tests
2016-10-12 13:33:16 -07:00
Francisco Gamino ccffe0755f Skipping New-PSRoleCapabilityFile and Get-PSSessionCapability on help system test since there is no help content for these two cmdlets (#2464) 2016-10-12 12:17:51 -07:00
Francisco Gamino d717458e7d Fixing get-help <cmdletName> -online for .NET Core on Desktop. (#2174)
In PS Core on windows, we try to locate the default web browser and use it for online help. If we cannot find the default web browser (in NanoServer/IoT), we error out.
2016-10-12 12:16:32 -07:00
Paul Higinbotham 3815482082 Fix host remote test InvokeOnRunspace to work with AppVeyor (#2362)
* Fix host remote test InvokeOnRunspace to work with AppVeyor

* Updated to use new local account for remoting tests.

* Set the LocalAccountTokenFilterPolicy as needed.

* Adding verbose messages for debugging.

* Storing creds using Export-CliXml

* Added CITravis skip for Windows only remoting test

* Moving tests back to 'Feature' scope

* Added AppVeyor environment variable check to prevent account creation on non-appveyor configurations

* Removed It block in BeforeAll block

* Moving tests back to 'Feature'
2016-10-10 15:24:04 -07:00
Mike Richmond e188c992e8 Fixing JSON property accessor to attempt user settings directory creation on the first write operation 2016-10-07 21:45:38 -07:00
iSazonov 6ef590dee3 Fix Get-WinEvent -FilterHashtable to work with named event data field (#2373)
Fix Get-WinEvent -FilterHashtable to work with named event data field

Now FilterHashtable parameter in Get-WinEvent for named data field:
1. generates a valid query, ex. @{Logname="System";Param="a"}
2. generates a valid query for multiple values, ex.
@{Logname="System";Param="a","b"}

Also removed double cast in the original code and added more tests to cover the fixed scenarios.
2016-10-07 11:48:08 -07:00
Christopher Ubben 62d7961aa8 Added feature level test coverage to FileSystem provider (#2416) 2016-10-07 10:36:13 -07:00
Dongbo Wang e078b0acb7 Use 'CurrentCulture' for error message and update test to clean up resources 2016-10-05 16:18:50 -07:00
charub d2feb51132 Added testcase for validating invalid filepath scenario. (#1749) 2016-10-05 16:18:50 -07:00
charub 88d64c243e Fix Start-Transcript input path validation (#1749) 2016-10-05 16:18:50 -07:00
Christopher Ubben 5da825bdb1 Added feature level test coverage to Alias provider (#2419) 2016-10-05 14:46:52 -07:00
Christopher Ubben 0e190e0bb8 Added feature level test coverage to PSDrive provider (#2418) 2016-10-04 13:11:33 -07:00
Dongbo Wang 13455204a4 Fix variable assignment to not overwrite readonly/constant variables (#2400) 2016-10-03 15:25:52 -07:00
Dongbo Wang 5fbde6eb40 Fix bytewise operators to work on enum types with 'System.Byte' as the underlying type (#2411) 2016-10-03 15:24:39 -07:00
Chris Ubben 9885917481 Adding test coverage for Variable provider 2016-10-03 10:39:32 -07:00
Aditya Patwardhan 3700d108b3 Start process test (#2397)
Mark test as pending to unblock daily builds
2016-09-30 16:33:42 -07:00
Aditya Patwardhan 877c193af0 Add RequireAdminOnWindows tag for install-package tests (#2390)
Add the tag RequireAdminOnWindows tags so that these tests do not fail on
daily builds.
2016-09-29 18:13:33 -07:00
Mike Richmond 374e1d1b21 Merge pull request #2280 from vors/admin-tests
Separate tests on Windows CI to Admin-Required and Non-Admin-Required
2016-09-29 16:28:29 -07:00
James Truher [MSFT] 24f9dea287 Add tests for queries against userdata (#2388)
add a custom evtx file for the userdata tests to use
2016-09-29 16:23:12 -07:00
Sergei Vorobev 9cc905dea4 Add verbose comment about the execution policy test
'-Scope LocalMachine is Settable, but overridden'
2016-09-29 16:06:42 -07:00
Aditya Patwardhan 561824c306 Change fwlink to use http instead of https.
An issue was filed for corefx team for httpclient.getasync with https and
redirects. https://github.com/dotnet/corefx/issues/12171
2016-09-29 12:39:56 -07:00
Sergei Vorobev 735bcca4d0 Allow ExecutionPolicy tests to throw specific type of error
Split LocalMachine test case into two separate tests:
- One without overriden policy (throws exception)
- One with overriden policy
2016-09-29 12:29:27 -07:00
Sergei Vorobev a1ee6d840d Make ExecutionPolicy.Tests.ps1 admin-aware 2016-09-29 12:29:27 -07:00
Sergei Vorobev 06d274995e Make LocalGroup tests admin-aware 2016-09-29 12:29:27 -07:00
Sergei Vorobev 56489b17bc Make Registry.Tests.ps1 admin-aware 2016-09-29 12:29:27 -07:00
Sergei Vorobev 93495a4f54 Timezone tests require Admin on Windows 2016-09-29 12:29:27 -07:00
Sergei Vorobev 50b04212c6 Restructure PowerShellGet.Tests.ps1 to enable 'RequireAdminOnWindows' tagging 2016-09-29 12:29:27 -07:00
Sergei Vorobev dcc10bc771 Change install scope for Install-PackageProvider.Tests.ps1
This helps avoid problem when run as non-elevated user.
2016-09-29 12:29:27 -07:00
Sergei Vorobev fdc69f0c3f Add 'RequireAdminOnWindows' tag to some tests suites 2016-09-29 12:29:27 -07:00
Dongbo Wang 124a59b8a8 Merge pull request #2363 from lzybkr/maxvars
Remove most Maximum* capacity variables
2016-09-28 17:28:16 -07:00
Jason Shirk (POWERSHELL) 39db1ec402 Add capacity test for initialsessionstate 2016-09-28 16:54:31 -07:00
Mike Richmond 0c9abbc9a4 Merge pull request #2379 from JamesWTruher/jameswtruher/moveEngineCoreTest
Move tests to more appropriate places now that we have the directory structure defined
2016-09-28 15:59:40 -07:00
Dongbo Wang d32bf23708 Merge pull request #2378 from JamesWTruher/jameswtruher/addwineventtest
Add additional tests for Get-WinEvent cmdlet
2016-09-28 15:35:26 -07:00
James Truher a8aeb55edb Move tests to more appropriate places now that we have the directory structure defined 2016-09-28 14:57:50 -07:00
JamesWTruher bfac47f3f1 Add return in BeforeAll to avoid running get-winevent cmdlet on non-Windows platforms 2016-09-28 14:29:47 -07:00
JamesWTruher f1c854176d Add additional tests for get-winevent for the xpath, xml and hashtable filters
Still left to do is handling the non-System queries (such as UserData)
2016-09-28 14:23:20 -07:00
JamesWTruher 4809414af5 Add new tests for Get-WinEvent 2016-09-28 12:21:56 -07:00
Mike Richmond adf6250175 Moving ExecutionPolicy tests to Microsoft.PowerShell.Security and refactoring test skipping for Windows. 2016-09-28 10:55:50 -07:00
Mike Richmond 20d4374fa8 Fixing how the LocalAcccounts tests are skipped in Pester 2016-09-27 16:30:25 -07:00
Charu Bassi 5cbf1b43de Fix 'Get-ChildItem -Hidden' to work on system hidden files like c:\hiberfil.sys c:\pagefile.sys and c:\swapfile.sys 2016-09-27 16:13:03 -07:00
Dongbo Wang d04460657d Merge pull request #2336 from lzybkr/stdin_fixes
Fix some issues with `powershell -Command -`
2016-09-27 11:20:43 -07:00
Aditya Patwardhan 9d1d927ecd Fix CategoryInfo.Activity so that it has the specified value
CategoryInfo.Activity of Write-Error does not honor the value for
'activity' but uses the hard-coded string 'write-error'. The change sets
the value if specified by Write-Error cmdlet or set 'write-error'.
2016-09-27 09:50:43 -07:00
Dongbo Wang 1ea555810c Fix Get-Credential to not prompt twice when no parameter is specified 2016-09-27 09:49:28 -07:00
Aditya Patwardhan a27b2303bb Add test coverage for Command discovery and requires (#2285) 2016-09-26 13:36:04 -07:00
Dongbo Wang 5d2f52e4e9 Fix indentation in the test 2016-09-26 11:56:12 -07:00
Dongbo Wang 89b5ae5de1 Fix $? assignment to not crash powershell 2016-09-26 11:56:12 -07:00
Mike Richmond f991d5fea4 Merge pull request #2348 from ChrisUbben/FixThrowTypo
Fixed all misspelling of throw in Archive tests
2016-09-22 17:14:36 -07:00
Mike Richmond 5e4e651724 Merge pull request #2307 from ChrisUbben/PortTestMultiMachineProvidersRegistry
Adding test coverage for Registry provider
2016-09-22 17:14:12 -07:00
Chris Ubben a45ea54111 Removed all misspelling of throw 2016-09-22 16:49:25 -07:00
Dongbo Wang bf7d8e0e5b Merge pull request #2266 from ChrisUbben/PortTestMultiMachineProvidersFileSystem
Adding test coverage for FileSystem provider
2016-09-22 14:23:32 -07:00
Mike Richmond 5c88dbf326 Merge pull request #2241 from jeffbi/convertto-html-coreclr
Make ConvertTo-Html work on CoreCLR
2016-09-22 13:24:17 -07:00
James Truher [MSFT] e143b41533 move native execution tests to Language/Scripting/NativeExecution (#2333)
update testing-guidelines.md with new locations
2016-09-22 11:57:42 -07:00
Dongbo Wang bf59194c6e Fix binary operator tab completion (#2338) 2016-09-22 11:56:38 -07:00
Dongbo Wang 309bf603f9 Merge pull request #2264 from ChrisUbben/PortTestMultiMachineProvidersAlias
Adding test coverage for Alias provider
2016-09-21 15:28:36 -07:00
Jason Shirk (POWERSHELL) 1913244fad Fix powershell -Command - handling of backspace
PowerShell can be started with input redirected in different scenarios.

`powershell -Command -` is one scenario where commands are sent to
PowerShell, but this is not a interactive shell scenario, it's really
a server to run commands from some other process.

`powershell -File -` or just regular redirected input means PowerShell
is an interactive shell, but command line editing must be done via
the redirected standard input handle instead of interacting directly
with a console handle.

In this scenario, we want to provide a good editing experience. Today,
we provide the bare minimum, supporting backspace but no cursor movement.

The bug here is that backspace was treated as a backspace in the server mode
but should not have been.
2016-09-21 15:01:33 -07:00
Jason Shirk (POWERSHELL) f095320787 Fix powershell -Command - to not ignore last command
If the last command sent via stdin did not have a newline,
the command was ignored. This would happen when stdin was closed.
2016-09-21 14:42:16 -07:00
Chris Ubben 4c9173f34f Adding test coverage for Registry provider 2016-09-21 13:36:03 -07:00
Chris Ubben 5e29753e9a Adding test coverage for FileSystem provider 2016-09-21 13:25:38 -07:00
Chris Ubben a55155ac53 Adding test coverage for Alias provider 2016-09-21 13:12:40 -07:00
Chris Ubben 9c548856f2 Adding test coverage for PSDrive provider 2016-09-21 13:02:34 -07:00
Yanbing 87f6e8d040 Add tests to language part 5 (#2218)
1. Added parameterbinding test
2. Added ShouldBeErrorID function in helper file
3. Removed ShouldBeErrorID function from other test modules
4. Update New-TestHost to be able to run on full CLR
5. updated file map.json
2016-09-16 16:54:48 -07:00
McAndersDK 5738f37b74 Added support for title in get-Credential, and message set to optional. (#1904)
* Update CredentialCommands.cs

Added possibility to add title to the credential prompt window.
Added possibility to only supply username without giving a message.

* Added Test for Get-Credential new feature. (Title, and Message only optional.)
2016-09-16 14:53:55 -07:00
Dongbo Wang 0426b44541 Merge pull request #2156 from charub/StartProcessIssue
Provide an unsupported message for 'Verb' parameter (#1691)
2016-09-15 21:00:06 -07:00
Yanbing edb292face Add tests for the Language (#2118)
DeserializedMethods, DeserializedTypeConversion,
DynamicParameters, Generics, Indexer, LindEndings, MyInvocation,
OrderedAttributeForHashTable.
2016-09-15 11:27:44 -07:00
charub 3d7beb4425 Provide an unsupported message for 'Verb' parameter (#1691)
Add the 'Verb' parameter to Powershell core and add an unsupported message
for the same.
2016-09-15 10:50:36 -07:00
Sergei Vorobev a266f11b00 Merge pull request #2182 from douglaswth/fix-passing-escaped-double-quoted-spaces-to-native.exe
Fix passing escaped double quoted spaces to native executables
2016-09-14 19:07:56 -07:00
Dongbo Wang 151585535d Merge pull request #2250 from mirichmo/mirichmo/localgroup-description-length
Removing length restriction on Description since SAM allows greater than 48 characters
2016-09-14 17:57:22 -07:00
Mike Richmond d3a49c2a54 Merge pull request #2265 from daxian-dbw/improve-modulepath
Improve ModulePath calculation and refactor related method names
2016-09-14 17:22:47 -07:00
PowerShell Team db2a0a6ca9 Adding ported LocalAccounts tests 2016-09-14 17:18:13 -07:00
Dongbo Wang b35d6126b2 Merge pull request #2239 from JamesWTruher/jameswtruher/testgap-004
Jameswtruher/testgap 004
2016-09-14 17:01:28 -07:00
Dongbo Wang 8669658d84 Add more sxs module path tests and make the basic sxs module test run on both powershell core and windows powershell 2016-09-14 15:19:12 -07:00
Paul Higinbotham 0ba1e2d9d1 Minor improvements to SSH remoting cmdlets (#2249)
* Fix for relative paths for KeyFilePath cmdlet parameter, renamed cmdlet KeyPath parameter to KeyFilePath parameter, and added tests.

* Code review comment update

* Added missing KeyFilePath check

* Test fix from review comment
2016-09-14 15:13:10 -07:00
James Truher eaef22686f Add a test for get-runspace -name and remove the runspace close from AfterAll block 2016-09-14 13:51:10 -07:00
James Truher 3dd686027c Add get-runspace -name test, remove runspace.close from AfterAll, dispose alone will suffice 2016-09-14 13:51:10 -07:00
James Truher 89946ed280 removed aggressive runspace cleanup code
also changed get-runspace test when multiple runspaces are present
to look for explicit runspace ids
2016-09-14 13:51:10 -07:00
James Truher 154cd992b4 make the language more clear for the PSStandaloneMonitorRunspaceInfo test 2016-09-14 13:51:10 -07:00
James Truher 97c4bbe952 don't use git to determine where the common directory is
it's not portable for our lab environment, where git may not exist
2016-09-14 13:51:10 -07:00
James Truher f00f82d85c fix up Get-Runspace test to be sure it has a clean environment before starting 2016-09-14 13:51:10 -07:00
James Truher 4bba7c8e62 adding convert-path tests 2016-09-14 13:51:10 -07:00
James Truher 4ef068c3d6 Rewrite to use $TESTDRIVE which does auto cleanup 2016-09-14 13:51:10 -07:00
James Truher 51f0a29a48 Start adding runspace debugging API tests 2016-09-14 13:51:10 -07:00
James Truher 4d046379e0 Add Get-Runspace tests 2016-09-14 13:51:10 -07:00
James Truher 3c9d8a82aa changing Package tests tags to Feature, as they go off box and should not be CI 2016-09-14 13:51:10 -07:00
James Truher 4ca0d68c37 additional tests to close gaps
Move-Item was identical to Rename-Item
2016-09-14 13:51:10 -07:00
Jeff Bienstadt 63bb074d5c Update test per code review 2016-09-14 12:51:06 -07:00
Sergei Vorobev 81a598f242 Merge pull request #2089 from 0xfeeddeadbeef/master
Use prefixed QNames in XPath expressions used by all implementations of ICmdletProviderSupportsHelp interface
2016-09-13 15:14:46 -07:00
Douglas Thrift ddf30c4008 Use a variable instead of a file for testing args
* Use a variable (which can be indexed by line) instead of a file to
  test the output of arguments passed to echoargs
* Add comments explaining the tests
2016-09-13 13:37:42 -07:00
Douglas Thrift 4d5d0a0034 Rename Publish-EchoArgs to Publish-PSTestTools
* Rename Publish-EchoArgs to Publish-PSTestTools so it can be used
  for other tools as well in the future
* Publish EchoArgs to the bin directory instead of run to match
  convention
* Add source URL to EchoArgs header comment
* Use wildcard of "*.nuget.props" to match
  "test/csharp/csharp.nuget.props" in .gitignore
2016-09-13 13:37:42 -07:00
Douglas Thrift 7e8070276f Move and "publish" EchoArgs for the tests
* Move EchoArgs from test/EchoArgs to test/tools/EchoArgs
* Use "dotnet publish" for building EchoArgs in build.psm1 so the test
  can call it directly
2016-09-13 13:37:42 -07:00
Douglas Thrift 7816516c24 Add tests for native command arguments 2016-09-13 13:37:42 -07:00
Paul Higinbotham 79ddafcc85 Fix for Linux remote script debugging hang (#2213)
* Fix for Linux remote debugging hang bug.

* Removing dependency in PSReadLine on new engine helper API since it needs to be compatible with V3.
2016-09-13 11:31:48 -07:00
George Chakhidze db330207dd Make sure we log that tests for Cert:\ and WSMan:\ provider-specific help are skipped 2016-09-13 10:26:53 +04:00
George Chakhidze e8190a569b Use prefixed QNames in XPath expressions used by all implementations of ICmdletProviderSupportsHelp interface
Also includes these bugfixes:
  - WSManConfigProvider.GetHelpMaml: Tried to load XML from
    MemoryStream that was created from file name string. Use XmlReader
    instead.
  - WSManConfigProvider.GetHelpMaml: Use Path.Combine instead of
    platform-specific directory separator character.
  - WSManConfigProvider.GetHelpMaml: CmdletHelpPath MAML XML element
    attribute `ID` name casing seems inconsistent with other help.xml
    files. XPath 1.0 does not support case-insensitive expressions,
    use both `id` and `ID` in query.
  - Add Pester test to verify that Get-Help shows provider-specific help.

Fixes #2088
2016-09-13 09:40:14 +04:00
Yanbing fd4552bfb8 Added tests for hashtabletoPSCustomObjectConversion, OutErrorVairable tests (#2160) 2016-09-12 18:29:55 -07:00
Jeff Bienstadt e8481e6a53 Make ConvertTo-Html work on CoreCLR
This also includes some Pester test for the cmdlet.
2016-09-12 11:17:59 -07:00
Yanbing e1bfe97d87 Add tests to language part 1 (#2086) 2016-09-12 10:43:53 -07:00
Sergei Vorobev ea5b6720cd Merge pull request #2092 from bingbing8/Add-Tests-to-language-part-2
Add tests to language part 2
2016-09-10 10:07:35 -07:00
Yanbing Wang 2530207d2a move help tests to feature. It generate two much log 2016-09-07 17:34:38 -07:00
Yanbing Wang c5b90ca656 fixed indentation 2016-09-02 13:28:20 -07:00
Yanbing Wang 11e279d688 Update based on PR feedback 2016-09-02 11:07:18 -07:00
Dongbo Wang 58a2ba730d Merge pull request #2046 from xiaoyinl/use-https-links
Use HTTPS links for go.microsoft.com
2016-09-01 17:23:09 -07:00
Jason Shirk bc8d537884 Merge pull request #2067 from JamesWTruher/jameswtruher/testgapfile-002
Fill more gaps in cmdlet test coverage
2016-09-01 11:16:32 -07:00
Yanbing Wang b488d7eb35 Update the path to LanguageTestSupport.psm1 -force 2016-09-01 10:31:10 -07:00
Yanbing Wang c06becaadd update map.json 2016-08-31 16:00:06 -07:00
Sergei Vorobev 1638bdf3e6 Merge pull request #2063 from jsoref/spelling-test
spelling fixes: tests
2016-08-31 14:13:49 -07:00
Jason Shirk cf18010ad5 Fix multi-line input w/ redirected stdin (#2090)
The input loop reading from stdin did not handle multi-line input correctly
because it was adding a newline character where none was expected.

The fix was to not include the final newline character to accept input,
just like Console.ReadLine or PSReadline would.
2016-08-31 13:52:46 -07:00
Dave Wyatt 22aac12c3e Add support for multiple paths to Join-Path
Multiple child paths can be specified via the new positional parameter -AdditionalChildPath.
2016-08-31 13:48:31 -07:00
Travis Plunk a814e6660c Mark failing test as pending 2016-08-31 12:17:07 -07:00
James Truher 4dc09f504c change throw message 2016-08-30 16:52:00 -07:00
James Truher 2824e136cb update exception messages 2016-08-30 16:15:10 -07:00
James Truher 3ceca01b64 address some review feedback 2016-08-30 16:15:10 -07:00
James Truher f4ed351f86 fix typos in test descriptions 2016-08-30 16:15:10 -07:00
James Truher 6aac4976fb Add simple runspace debugging tests 2016-08-30 16:15:10 -07:00
James Truher 9c99bdbef9 Add new debugging tests which are based on existing earlier non-Pester tests 2016-08-30 16:15:10 -07:00
James Truher d3a177d6ae Add simple securestring conversion cmdlet tests 2016-08-30 16:15:10 -07:00
James Truher 52ba25be69 Add simple Enable-PSBreakpoint and Disable-PSBreakpoint cmdlet tests 2016-08-30 16:15:10 -07:00
James Truher 763fe2bdbf fix missing ";" in Streams.Clear 2016-08-30 16:15:10 -07:00
James Truher f6ae238641 quiet the start-process tests by redirecting all output 2016-08-30 16:15:10 -07:00
James Truher 01c495b5e6 Change Import-PowerShellDataFile tag to CI and simplify tests 2016-08-30 16:15:10 -07:00
James Truher c610ea7941 Add Set-Date test 2016-08-30 16:15:10 -07:00
James Truher e639240ecb Add set-Date test
this one is a bit tricky, unless you're elevated you can't set the date
however, if you are not elevated you should get an error. This file
does one or the other based on whether you're elevated
2016-08-30 16:15:10 -07:00
James Truher feae8e4b2d add read-host tests 2016-08-30 16:15:10 -07:00
Yanbing Wang 08d65596cd removed the first 3 lines in i18n.Tests.ps1 2016-08-30 12:17:27 -07:00
Yanbing Wang 04f225a4a1 Update i18n.Testsps1 to use PSDefaultParameterValues 2016-08-29 17:54:20 -07:00
Jumping Yang[Wicresoft] d59b322032 Add BooleanParameterDCR and Eventing Pester Test (#2031)
* Add BooleanParameterDCR and Eventing Pester Test

* Correct describe for Eventing Pester Test

* Add ProviderIntrinsics and Serialization Pester Test
2016-08-29 13:01:03 -04:00
Yanbing Wang bbbd6a9dfc Change some context to it 2016-08-26 19:37:51 -07:00
Manikyam Bavandla 1e13d7897a Update PowerShellGet to install the modules and scripts to proper locations in PowerShell Core on Windows (#2078)
* 1. Update PowerShellGet to install the modules and scripts to proper locations in PowerShell Core on Windows. 2. Added few CI tests for PowerShellGet

* Handling the scenario of FullCLR-based PowerShell on Windows.
2016-08-26 16:58:22 -07:00
Yanbing Wang 312ec5ffd0 Add Tests for parsing, international, and script help. 2016-08-26 14:49:44 -07:00
Josh Soref 2badb244de spelling fixes: test 2016-08-25 17:49:32 +00:00
xiaoyinl f538eeb416 Use HTTPS links for go.microsoft.com
I replace all occurrences of http://go.microsoft.com with https://go.microsoft.com in text files.
2016-08-23 21:21:31 -04:00
Mike Richmond 18f3589d68 Fixing the path to the user's JSON configuration file 2016-08-23 15:45:49 -07:00
James Truher 9d1c998287 Filling test gaps (issue 2022) - this replaces PR 1834
This replaces PR 1834 from the private fork I had
2016-08-22 14:56:04 -07:00
Barry Nolte 890e80dd54 Getting tests to run from build directory with spaces in it (#1981)
* [build.psm1] - mc.exe input file needs quotes

For filenames that have spaces or paths to that file that have spaces, the input filename needs to have quotes around it.

* Quoted more paths so tests run from directories with spaces

Found a few locations where paths weren't qutoed or escaped with '& ...' that are needed to get tests to run from build directories with spaces in them.
2016-08-22 09:57:30 -04:00
James Truher 5644c4c54b Create new test for Get-Credential which requires module to create a test host 2016-08-19 13:01:04 -07:00
Micah R Ledbetter be186e833b Correct link to Pester Do and Don't document 2016-08-19 11:29:50 -05:00
Jason Shirk 8b056776c0 Stop using 'Open PowerShell' and OPS in code (#1838) 2016-08-16 17:03:34 -07:00
Dongbo Wang 9ab60d6621 Fix the test that fails in Travis CI build (#1792) 2016-08-12 18:36:16 -07:00
Jason Shirk e550b6920c Merge pull request #1337 from PowerShell/TestGetCommand
Add Pester test for TestGetCommand.cs
2016-08-12 11:41:02 -07:00
Mike Richmond 539c59cc35 Merge pull request #1721 from PowerShell/dongbo/module-path
Address the side-by-side module path for OPS
2016-08-12 11:30:10 -07:00
Jason Shirk 22a1f0a8b7 Merge pull request #1676 from PowerShell/NullableBooleanDCR
Add NullableBooleanDCR Pester Test
2016-08-12 11:21:20 -07:00
Dongbo Wang 401b6194da Address review comments in test code 2016-08-12 11:01:46 -07:00
TingLiu6 d0c62017a9 Add NullableBooleanDCR Pester Test 2016-08-12 00:21:28 -07:00
Dongbo Wang 23ed0e4fa2 Use capital 'PSMODULEPATH' in tests so that it works in unix 2016-08-11 21:45:20 -07:00
Dongbo Wang 8bb291896c Change 'Platform.XDG_Type' and 'Platform.SelectProductNameForDirectory' back to 'public'
Add CI tests for the module path change
2016-08-11 21:45:20 -07:00
Dongbo Wang 753b202a75 Fix tests that were broken by the sxs module path change. Also fix some unreliable tests. 2016-08-11 21:45:20 -07:00
JumpingYang001 2d0d9765d9 Add Shell Interop Pester Test 2016-08-10 23:09:17 -07:00
Francisco Gamino 135af2089a Updating tests to install the help content before running on Windows 2016-08-10 12:19:51 -07:00
Francisco Gamino 2b1dc87774 Adding Feature tag to help tests 2016-08-10 12:19:51 -07:00
Francisco Gamino 233e75657a Breaking down help tests for CI and Feature test runs 2016-08-10 12:19:51 -07:00
Francisco Gamino 3ed7201e21 Fixing get-help on Linux 2016-08-10 12:19:51 -07:00
Andrew Schwartzmeyer d59710d310 Remove unimplemented Management cmdlets from Unix
These are not currently implemented and so should not show up as
available.

The *-Computer cmdlets are already not compiled for Unix (and so not
available), so let's not declare them in the manifest.

The Get-ComputerInfo cmdlet does not work on Unix and so should not be
made available.

Test-Connection depends on an unavailable WMI provider.

Get/Set-TimeZone are not yet ported.
2016-08-09 18:54:05 -07:00
Andrew Schwartzmeyer 280bd651c1 Remove unimplemented Utility cmdlets from Unix
ConvertFrom-SddlString and Unblock-File are Windows-specific cmdlets
with no equivalent on Unix.

squash! Remove Unblock-File from Unix
2016-08-09 18:53:43 -07:00
Travis Plunk 3d3e67fd4e Merge pull request #1641 from PowerShell/LanguagePrimitiveTest
Add Language Primitive Test
2016-08-09 12:14:02 -07:00
TingLiu6 c8e38ec506 Add Get-Command Pester Test 2016-08-08 20:19:11 -07:00
TingLiu6 a50114d5da Add Language Primitive Pester Test 2016-08-08 19:39:06 -07:00
Andrew Schwartzmeyer 5bc34eb63c Run Trace-Command tests on CI 2016-08-08 12:11:51 -07:00
Dongbo Wang ba2cd1d2b7 Merge pull request #1669 from andschwa/safe-hostname
Safe hostname
2016-08-08 11:10:53 -07:00
Andrew Schwartzmeyer a8416d7b30 Consolidate GetUserName code
Once .NET Core 1.1 becomes available, we can likely remove the entirety
of CorePsExtensions.cs.
2016-08-08 10:48:59 -07:00
Dongbo Wang 9a0436b856 Merge pull request #1661 from PowerShell/dongbo/get-pssession
Fix if/def guards to allow engine to load WsMan and Diagnostics snapins by default when RunspaceConfiguration is used to create a runspace
2016-08-05 13:00:06 -07:00
Dongbo Wang dc9b326587 Fix issue #1609 - Get-PSSession -computername fails on nano
Root cause: Microsoft.WSMan.Management  and  Microsoft.PowerShell.Commands.Diagnostics  are not put in the default snapin list for win-ops, and thus when a runspace is created using RunspaceConfiguration, those 2 are not loaded as snapins by default, which is a behavior change compared to Nano PS.
Fix: Replace the guard 'PORTABLE' to be 'UNIX' so that they are in the default snapin list when targeting windows platform.
2016-08-05 11:20:14 -07:00
Andrew Schwartzmeyer 09e1683098 Add Ubuntu 16.04 RID 2016-08-05 10:09:40 -07:00
TingLiu6 89d24fd8ba Add ParameterBinding Pester Test 2016-08-04 19:50:35 -07:00
Jason Shirk f15e66b283 Merge pull request #1633 from PowerShell/revert_psedition_namechange
Revert the changes made in #1457. Desktop and Core are the PowerShell Edition names. Remove Linux as edition name.
2016-08-04 12:21:12 -07:00
John Kordich ee7356e36e Disabling unit tests for OSX 2016-08-04 10:47:41 -07:00
John Kordich 0c7cbc1667 Adding Import-Module to MOF-Compilation tests 2016-08-04 10:47:41 -07:00
John Kordich e0fdf1ed00 Fixing up mof compilation test script to set PSMODULEPATH properly 2016-08-04 10:47:41 -07:00
John Kordich 643533b6a8 Adding DSC MOF compilation for Linux tests 2016-08-04 10:47:41 -07:00
Manikyam Bavandla eacfd9418c Revert "Merge pull request #1458 from PowerShell/psedition_rename"
This reverts commit 042d1e99bb, reversing
changes made to 105bf9c9ff.
2016-08-03 15:53:31 -07:00
Jason Shirk 31b3d13e10 Merge pull request #1623 from PowerShell/jimtru/PSDriveFreeSpaceFix
Get-PSDrive should report proper free space on all platforms
2016-08-03 14:11:28 -07:00
Jason Shirk (POWERSHELL) 420155517a Add serialization test of SemanticVersion 2016-08-03 13:21:42 -07:00
James Truher 1bbdaa7ea8 Change free/used calculation to be consistent across platforms
add a couple of tests to validate return values
2016-08-03 10:38:26 -07:00
Sergei Vorobev b654b7d4b1 Merge pull request #1501 from PowerShell/jameswtruher/CmdletTestMigration
Jameswtruher/cmdlet test migration
2016-08-02 14:09:10 -07:00
James Truher 6a07b71ba6 update tests to include $IsCoreCLR rather than $IsCore
also fix archive test to be sure it gets the proper archive module (not the one that's somewhere in the filesystem)
2016-08-02 12:50:24 -07:00
Jason Shirk cfba7537f3 Merge pull request #1599 from PowerShell/error-stream
Error stream
2016-08-02 12:15:13 -07:00
James Truher 0a18a46281 Update json tests to be more cross-plat and handle multiple invocations
only create the enumtest type if it doesn't exist
don't try to compare line endings on json tests which contain arrays,
formatting of the output need not be validated
2016-08-02 12:05:24 -07:00
James Truher dd0291be09 update encoding on the test files - these are ascii 2016-08-02 12:05:24 -07:00
James Truher 7b836f99f5 create work-around for MacOS in handling wildcards 2016-08-02 12:05:24 -07:00
James Truher 0f60b69af4 Fix Get-Command tests to better handle non-Windows platforms.
set executable bit on Linux/MacOS as that's what determines whether something
is executable. Also simplify partial path creation, only remove up to the first
colon, so those filesystems which have a single root are treated properly
2016-08-02 12:05:24 -07:00
James Truher 96a81c626c rename test files so they match map.json and can be found by invoke-pester 2016-08-02 12:05:24 -07:00
PowerShell Team 1d11f67376 fix two more file copy targets
they weren't being recognized as pester tests because they didn't have the right name
2016-08-02 12:05:24 -07:00
James Truher 176f9fb6bd rename archive test file so it may be found by invoke-pester 2016-08-02 12:05:24 -07:00
PowerShell Team 3575eac7b3 fix typo in archive test name
it needs to have the correct name in order to be executed by invoke-pester
2016-08-02 12:05:24 -07:00
PowerShell Team ce4303b873 migrated tests run clean on all platforms (locally) 2016-08-02 12:05:24 -07:00
PowerShell Team 0261372bae remove scheduled job tests 2016-08-02 12:05:24 -07:00
PowerShell Team 43eae99276 remove scheduledjob cmdlet tests 2016-08-02 12:05:24 -07:00
PowerShell Team 7305b82b73 Add migrated files 2016-08-02 12:05:24 -07:00
PowerShell Team 721ad34c62 add missing sample archive file 2016-08-02 12:05:24 -07:00
PowerShell Team 28a06155c8 add map.json file for migration of Pester cmdlet tests 2016-08-02 12:05:24 -07:00
JumpingYang001 86bf00e48b Add Adapter Pester Unit Test 2016-08-02 00:31:27 -07:00
Sergei Vorobev 5690b1a0d9 Add tests for Error stream 2016-08-01 18:40:51 -07:00
Jason Shirk 0513425ff9 Merge pull request #1566 from PowerShell/andschwa/chars
Fix PSReadLine custom key binding on Linux
2016-07-29 09:10:10 -07:00
Andrew Schwartzmeyer 9cc6673b27 Add regression tests for custom key bindings
Also tests capitalized key bindings, hence the need to compare case
sensitively.
2016-07-28 22:41:04 -07:00
Sergei Vorobev dac906db3d Skip $input type test per #1563 2016-07-28 18:02:24 -07:00
Dongbo Wang 14433e6b1f Update project.json files to keep sync with the new MMI nuget package 2016-07-28 17:07:57 -07:00
Sergei Vorobev a704a53f08 Make Get-Item env: case-aware on Unix
Fix #1196
2016-07-28 14:19:36 -07:00
Sergei Vorobev d591871b2c Add CI tag to SemanticVersion.Tests.ps1 2016-07-27 18:54:40 -07:00
Sergei Vorobev 06252836ea Make 'cd' go to the HOME directory 2016-07-27 18:43:19 -07:00
Sergei Vorobev aa72512c76 Merge pull request #1523 from lzybkr/semver
Semver
2016-07-27 18:35:12 -07:00
James Truher fa1b386a08 make sure that all tests are using the proper $IsCoreCLR variable instead of $IsCore 2016-07-27 12:32:17 -07:00
James Truher ac8238075d mark the add-type tests as pending for $IsCore 2016-07-27 12:14:08 -07:00
James Truher f0233a8d20 fix bad tag to check tag checking 2016-07-27 12:06:51 -07:00
James Truher 0b61bb6464 purposefully create a bad tag to test tag checks for build 2016-07-27 12:06:51 -07:00
James Truher 5e61213be9 update appveyor.yml to check for bad test tags
add the function to check tags to build.psm1
rename the parser tests so they actually execute
2016-07-27 12:06:51 -07:00
James Truher 456bc4da6b marked some package tests as feature rather than CI 2016-07-27 12:06:51 -07:00
James Truher 1b9565ae89 add tags to describe blocks that didn't have any tags 2016-07-27 12:06:51 -07:00
James Truher a784149b36 all tests are now marked with proper tag
also, update build.psm1 to be more flexible
2016-07-27 12:06:51 -07:00
James Truher 9e225ccae2 changes tags for tests
Start using tags CI, Feature, Scenario
2016-07-27 12:06:51 -07:00
Jason Shirk (POWERSHELL) 8e8ade947d Add SemanticVersion tests 2016-07-27 10:53:11 -07:00
Sergei Vorobev d8a040ca99 Add test for Add-Type System.Runtime.Serialization.Primitives.dll TPA 2016-07-26 17:53:52 -07:00