Commit graph

12 commits

Author SHA1 Message Date
Reece Dunham 2cbcd6c4fa
Remove unused code (#12610) 2020-05-11 11:59:22 -07: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
xtqqczze 090ad9cb33 Correct case of $PSVersionTable special variable 2020-01-13 19:36:31 +00:00
xtqqczze 743983390e Update pester syntax to v4 (#11544)
* Capitalize 'Should' command and fix whitespace

```powershell
$_ -ireplace '\s?\|\s?should\b',' | Should'
```

* Capitalise and apply hyphen to 'Not' parameter

```powershell
$_ -ireplace '(\| Should) not\b','$1 -Not'
```

* Capitalise and apply hyphen to 'Be' parameter

```powershell
$_ -ireplace '(\| Should(?: -Not)?) -?be\b','$1 -Be'
```

* Capitalise and apply hyphen to 'BeExactly' parameter

$_ -ireplace '(\| Should(?: -Not)?) -?beexactly\b','$1 -BeExactly'

* Capitalise and apply hyphen to 'BeGreaterThan' parameter

```powershell
$_ -ireplace '(\| Should(?: -Not)?) -?begreaterthan\b','$1 -BeGreaterThan'
```

* Use 'BeTrue' parameter

```powershell
$_ -ireplace '(\| Should(?: -Not)?) -Be\s\$?true\b','$1 -BeTrue'
```

* Use 'BeFalse' parameter

```powershell
$_ -ireplace '(\| Should(?: -Not)?) -Be\s\$?false\b','$1 -BeFalse'
```

* Capitalise and apply hyphen to 'Match' parameter

```powershell
$_ -ireplace '(\| Should(?: -Not)?)\s-?match\b','$1 -Match'
```

* Capitalise and apply hyphen to 'Throw' parameter

```powershell
$_ -ireplace '(\| Should(?: -Not)?)\s-?throw\b','$1 -Throw'
```

* Capitalise and apply hyphen to 'BeNullOrEmpty' parameter

```powershell
$_ -ireplace '(\| Should(?: -Not)?)\s-?benullorempty\b','$1 -BeNullOrEmpty'
```

* Capitalise 'Because' parameter

```powershell
$_ -ireplace '\s-because\b',' -Because'
```

* Fix 'BeNullOrEmpty'
2020-01-11 20:41:59 +05:00
Steve Lee a96b4c0404 Update use of "PowerShell Core" to just "PowerShell" (#9513) 2019-05-10 15:34:27 -07:00
Reece Dunham 9e4e50a84e Remove appveyor functions from New-DockerTestBuild.psm1 (#8756) 2019-01-31 11:15:31 -08:00
xtqqczze 6126624b63 Revise use of Start-Sleep cmdlet (#8633)
* Avoid use of sleep alias (follow-up to #8546)
* Specify default parameter name
* Shorten overly specific comments
2019-01-15 12:31:52 +05: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 2cc091115b Rename powershell.exe to pwsh.exe (#5101)
- Rename powershell.exe to pwsh.exe
- Fixe appveyor.psm1
- Update MSI to include 'pwsh' in path and app paths
- Revert change for hyper-v powershell direct
- Update names in packaging.psm1.
- Fix check for SxS
2017-10-17 17:25:11 -07:00
bergmeister ffd39b2853 PSScriptAnalyzer fixes by category (#4261)
- 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'
2017-07-21 21:03:49 -07:00
James Truher [MSFT] 63c20f15b1 Add dockerfile and test so we can test simple remoting behaviors (#3470)
* Add dockerfile and test so we can test simple remoting behaviors

this docker file creates an image which can be used to test remoting with containers.
We start with the microsoft/windowsservercore image and then set up the system for
testing by adding a user, setting up configuration for basic auth, installing
PowerShell Core, and creating a configuration endpoint for PSCore.

The tests are very simple; it retrieve $PSVersionTable.PSVersion in the following
connections:
   Full -> Full
   Full -> Core
   Core -> Full
   Core -> Core

* Add new file to bootstrap the docker image

fix the tests to be more resilient to changes in the version of the PSCore package

* update script to use local user cmdlets rather than net.exe

also remove pscore.msi at the end of the image build process to save space

* clean up commented lines and remove an unused parameter from one of the functions

also use constants more consistently

* remove reference to docker image name by string and use variable instead.
2017-04-21 17:23:08 -07:00