* Add file secret suppression
* Add line secret suppression
* This will be consumed in the VSTS daily build.
* Renamed tests with ConvertTo-SecureString to avoid false positives
* [feature]
allow * to be used in registry path for remove-item
* [feature]
address PR feedback
have remove-item return error if -literalpath doesn't resolve to path
* [feature]
fix in navigation exposed an issue with WSMan Config Provider tests
that require -Recurse to be used otherwise a confirmation prompt shows
up
* [Feature]Remove-Service added to Management module
* [Feature]Capitalization
* [Feature]Added test cases for Remove-Service, Removed return value
* [Feature]Documentation from copy-paste code corrected to reflect the new function
* [Feature]Erroraction to be sure that an error is thrown in testcase
* [Feature]Removed direct reference to module in Pester test
* [Feature]Removed extra line in test
* [Feature]Use FullyQualifiedErrorId in Remove-Service test without a valid servicename
* [Feature]Exposed Remove-Service
* [Feature]Consistent casing, Named Arguments & Remove incorrect exception on cleanup
* [Feature]Remove-Service test should fail if the service was not removed
* [Feature]Cleanup comments & add Remove-Service for CI
* [Feature]Remove-Service in CI set in alphabetic order
* [Feature]Use ParameterSetName instead of _ParameterSetName and rewrite test which used the function class directly
* Revert "[Feature]Use ParameterSetName instead of _ParameterSetName and rewrite test which used the function class directly"
This reverts commit da41f7deb8.
* [Feature]Remove _ParameterSetName check & added test for pipeline input in
Set-Service
* Add tests for Get-Content -Tail #4150
* Incorporated the review comments
* renamed couple of tests
* removed extra spaces
* Tests refactored into a Context and the checks broken down into separate tests
* Made the indents consistent with the other existing tests
* Incorporated the review comments
* Add '-ErrorAction Stop' in Set-Service.Tests.ps1 to correctly test exceptions.
* Refactor StartupType service code and add a throw for disabled startup types (System, Boot).
* Made StartupType(-1) equivalent to Win32 SERVICE_NO_CHANGE.
This change mitigates intermittent timeout failures in the access denied tests as well as fixes unintended cross-test dependencies. If PowerShell takes longer that 10 seconds to complete a race can cause the subsequent test to pick up the output file of the previous test and fail (i.e., the expected output error file already exists from the previous test because it was created by the long running PowerShell process after the second test started.) Worse case, the failure cascades causing the race to propagate through the remaining tests in the set.
The fix is two fold:
1: Increase the timeout for waiting for the launched powershell process. (mitigation)
2: Ensure each uses a unique name for the error and done files to avoid polluting the next test.
* Add -WhatIf switch to Start-Process cmdlet
* Add test for the -WhatIf switch
* Added a test to ensure that using a whatif switch prevents the action from being performed.
* Incorporated code review comments
* merged two tests into one as suggested
* Included the error action at the end of the cmdlet
* Remove extra space before `StringUtil` and new line
* Renamed the resource string id ProcessStartInfo to StartProcessTarget
* Make count of tests the same between Windows and Non-Windows platforms
Change logic so test cases are created for all platforms, but only load the helper module on windows
* Ensure Get-ComputerInfo tests run the same number of tests regardless of platform
* AlternateStreams support relies on pinvoke to win32 APIs which don't work on non-Windows and produces errors about not loading a DLL in the case of copy-item
* Address PR feedback, remove -Stream parameter for Unix added new -stream tests
* if/def out alternate stream syntax checks not applicable to Unix
* Add test coverage for Registry (#4148)
* Add coverage for Get-Item, Get-ChildItem, Set-Item, and Clear-Item
* Add test for accessing inaccessible path, per code review.
In CI, notepad.exe isn't starting (or starting in time) when using start-process with .txt based on file association.
Since the test is validating opening files by association, fix is to create our own association that is predictable.
- Fix PSScriptAnalyzer warnings of type PSAvoidUsingCmdletAliases for 'ForEach-Object' (alias is '%' or 'foreach')
- Fix PSScriptAnalyzer warnings of type PSAvoidUsingCmdletAliases for 'Where-Object' (alias is '?' or 'where')
- Fix PSScriptAnalyzer warnings of type PSAvoidUsingCmdletAliases for 'Select-Object' (alias is 'select')
- Fix PSScriptAnalyzer warnings of type PSPossibleIncorrectComparisonWithNull. Essentially, $null has to be on the left-hand side when using it for comparison.
- A Test in ParameterBinding.Tests.ps1 needed adapting as this test used to rely on the wrong null comparison
- Replace a subset of tests of kind '($object -eq $null) | Should Be $true' with '$object | Should Be $null'
Add the dynamic parameter `-FollowSymlink` to `Get-ChildItem`.
Add a mechanism for tracking visited directories.
Add native code to get device/inode information on Unix/Windows.
Add warning when refusing to enter an already-visited directory.
* Make Move-Item work with its -Include, -Exclude, and -Filter parameters (#2385)
Invoke the correct overload of SessionState.Path.GetResolvedPSPathFromPSPath, passing the cmdlet context object.
* Update tests per code review.
* Changes per code review.
* Remove stray comment
* Fixed OpenCover module and CodeCoverage launcher script
* Changes to layout of package caused some changes to package path.
* Added Test modules from tests\tools\modules
* Fixed Get-ChildItem test
* Added convertor for converting OpenCover output file to JSON.
* Updated how the file is uploaded to CodeCov.io
* Addressed code review comments
Added try/catch within the enumeration loop to allow the enumeration to continue after encountering an error such as an item within the directory being deleted or renamed.
To assist in testing, two new internal test hooks have been added which cause Get-ChildItem to either delete or rename a specific file (file name hard-coded) when encountered during enumeration.
Make changes to not expose the aliases "gin", "gsv", "sasv" and "spsv" in Unix platforms.
Also refactored aliases related tests and added new tests covering the complete list of built-in aliases/cmdlets.
* Add autoload for TestHelpers.psm1
Test.Helpers.psm1 was renamed to TestHelpers.psm1
* Resolve conflit and rebase Add autoload for TestLanguage.psm1
* Remove unneeded comments from PSD1 files
* Rename test modules
Remove approved verbs (Get-Verb) from module names.
* Enhance ShouldBeErrorId to output exception into pipeline for later analysis
* Remove unneeded comments
* Resolve merge conflict
Brings the Get-ChildItem more in line with the Unix ls -r and the Windows DIR /S native commands. Like these commands, the cmdlet will display symbolic links to directories found during recursion but will not recurse into them.
Like the Unix ls command---and unlike the Windows DIR /S command--- the cmdlet will recurse into symlinks given on the command line.
* Fix Rename-Item to allow Unix globbing patterns in -Literal paths (#2799)
In the process of normalizing a relative path, PowerShell checks to see
see if the path exists, which it does by invoking
Directory.EnumerateFiles(directory, filename);
On Unix platforms, if the filename contains globbing patterns, such as [ab],
EnumerateFiles (and EnumerateDirectories) will perform the globbing. Using
globbing patterns, a file named 'file[txt].txt' is reported as not existing.
This fix changes the file-existence test on Unix to use a native function
instead of either of the Directory.EnumerateXXX functions.
* Fix for AppVeyor failure
* Changes per code review, and a couple of letter-casing changes.