Commit Graph
16 Commits
Author SHA1 Message Date
Armaan Mcleod d24285f437 Remove input text from the error message resulted by SecureString and PSCredential conversion failure (#19977) 2023-07-17 10:30:10 -07:00
Paul Higinbotham 0d7ba2fe5a Fix ConvertTo-SecureString with key regression due to .NET breaking change (#16068) 2021-09-09 10:36:05 -07:00
Steve Lee 9bf512ff5d Emit warning if ConvertTo-Json exceeds -Depth value (#13692) 2020-09-28 21:22:40 +05:00
xtqqczze f4382202ae Use correct casing for cmdlet name and cmdlet parameter name in *.ps1 files (#12584) 2020-05-07 17:00:30 +05:00
Steve Lee b7cb335f03 Update copyright notice to latest guidance (#12190) 2020-03-24 11:08:37 -07:00
Steve Lee 03f10f052d Add -AsPlainText to ConvertFrom-SecureString (#11142) 2019-12-11 15:40:41 -08:00
Steve LeeandTravis Plunk 3255d84627 Enable SecureString cmdlets for non-Windows (#9199)
On Unix systems, fallback to plaintext manipulation instead of using the DPAPI which is not available.

## PR Context

Currently, existing scripts that use SecureString cmdlets fail with an error complaining about crypt32.dll not being available.  This change allows these cmdlets to be used, but there is no encryption of the string.
.Net already [states](https://docs.microsoft.com/en-us/dotnet/api/system.security.securestring?view=netcore-2.1#remarks) that the contents of a SecureString are not encrypted on .Net Core.

Fix https://github.com/PowerShell/PowerShell/issues/1654

Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
2019-03-23 10:11:05 -07:00
Klaudia Algiz 2df9aac811 Convert ShouldBeErrorId to Should -Throw -ErrorId in PowerShell tests (#6682)
Convert ShouldBeErrorId to Should -Throw -ErrorId in PowerShell tests.
Get rid of try { } catch { } formula to assert that errors were thrown.
Small fixes in tests to obey the new Pester -Parameter syntax.
2018-05-17 14:42:04 -07:00
Kevin Marquette acb52b3d9c Update tests in Microsoft.PowerShell.Security folder to use Pesterv4 syntax (#6256) 2018-03-23 10:41:14 -07:00
Steve Lee c1c5344a88 Update copyright and license headers (#6134)
Based on standard practices, we need to have a copyright and license notice at the top of each source file. Removed existing copyrights and updated/added copyright notices for .h, .cpp, .cs, .ps1, and .psm1 files.

Updated module manifests for consistency to have Author = "PowerShell" and Company = "Microsoft Corporation". Removed multiple line breaks.

Separate PR coming to update contribution document for new source files: #6140

Manually reviewed each change.

Fix #6073
2018-02-13 09:23:53 -08:00
Steve Lee 25a32284dd fix tests not setting back $psdefaultparametervalues back correctly (#4892) 2017-09-23 13:48:51 -07: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
Jason Shirk 02b5f357a2 Remove trailing whitespace (#3001) 2017-01-16 13:31:14 -08:00
2xmax 1ccd155917 fixed some expected exception tests according to the template https://github.com/PowerShell/PowerShell/blob/611f7f9b77f7bb336bc4c4069135eac8520bb77a/docs/testing-guidelines/WritingPesterTests.md#L54 2017-01-05 18:23:37 -08:00
James Truher 2824e136cb update exception messages 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