mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Correct case of $false special variable
This commit is contained in:
@@ -186,7 +186,7 @@ Describe "ConsoleHost unit tests" -tags "Feature" {
|
||||
It "-File should be able to pass bool string values as string to parameters: <BoolString>" -TestCases @(
|
||||
# validates case is preserved
|
||||
@{BoolString = '$true'},
|
||||
@{BoolString = '$falSe'},
|
||||
@{BoolString = '$false'},
|
||||
@{BoolString = 'trUe'},
|
||||
@{BoolString = 'faLse'}
|
||||
) {
|
||||
@@ -199,7 +199,7 @@ Describe "ConsoleHost unit tests" -tags "Feature" {
|
||||
It "-File should be able to pass bool string values as string to positional parameters: <BoolString>" -TestCases @(
|
||||
# validates case is preserved
|
||||
@{BoolString = '$true'},
|
||||
@{BoolString = '$falSe'},
|
||||
@{BoolString = '$false'},
|
||||
@{BoolString = 'tRUe'},
|
||||
@{BoolString = 'fALse'}
|
||||
) {
|
||||
@@ -211,7 +211,7 @@ Describe "ConsoleHost unit tests" -tags "Feature" {
|
||||
|
||||
It "-File should be able to pass bool string values as bool to switches: <BoolString>" -TestCases @(
|
||||
@{BoolString = '$true'; BoolValue = 'True'},
|
||||
@{BoolString = '$faLse'; BoolValue = 'False'},
|
||||
@{BoolString = '$false'; BoolValue = 'False'},
|
||||
@{BoolString = 'tRue'; BoolValue = 'True'},
|
||||
@{BoolString = 'fAlse'; BoolValue = 'False'}
|
||||
) {
|
||||
|
||||
@@ -741,28 +741,28 @@ foo``u{2195}abc
|
||||
@{ Script = 'if (0 -or 1) { $true } else { $false }'; Expected = $true }
|
||||
@{ Script = 'if (0 -or 0) { $true } else { $false }'; Expected = $false }
|
||||
#-eq
|
||||
@{ Script = 'if ($False -eq $true -and $False) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($False -and $true -eq $False) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($false -eq $true -and $false) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($false -and $true -eq $false) { $true } else { $false }'; Expected = $false }
|
||||
#-ieq
|
||||
@{ Script = 'if ($False -ieq $true -and $False) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($False -and $true -ieq $False) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($false -ieq $true -and $false) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($false -and $true -ieq $false) { $true } else { $false }'; Expected = $false }
|
||||
#-le
|
||||
@{ Script = 'if ($False -le $true -and $False) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($False -and $true -le $False) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($false -le $true -and $false) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($false -and $true -le $false) { $true } else { $false }'; Expected = $false }
|
||||
#-ile
|
||||
@{ Script = 'if ($False -ile $true -and $False) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($False -and $true -ile $False) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($false -ile $true -and $false) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($false -and $true -ile $false) { $true } else { $false }'; Expected = $false }
|
||||
#-ge
|
||||
@{ Script = 'if ($False -ge $true -and $False) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($False -and $true -ge $False) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($false -ge $true -and $false) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($false -and $true -ge $false) { $true } else { $false }'; Expected = $false }
|
||||
#-ige
|
||||
@{ Script = 'if ($False -ige $true -and $False) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($False -and $true -ige $False) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($false -ige $true -and $false) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($false -and $true -ige $false) { $true } else { $false }'; Expected = $false }
|
||||
#-like
|
||||
@{ Script = 'if ($False -like $true -and $False) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($False -and $true -like $False) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($false -like $true -and $false) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if ($false -and $true -like $false) { $true } else { $false }'; Expected = $false }
|
||||
#!
|
||||
@{ Script = 'if (!$true -and $False) { $true } else { $false }'; Expected = $false }
|
||||
@{ Script = 'if (!$true -and $false) { $true } else { $false }'; Expected = $false }
|
||||
)
|
||||
It "<Script> should return <Expected>" -TestCases $testData {
|
||||
param ( $Script, $Expected )
|
||||
|
||||
@@ -53,7 +53,7 @@ Describe "Start-Transcript, Stop-Transcript tests" -tags "CI" {
|
||||
|
||||
AfterEach {
|
||||
Remove-Item $transcriptFilePath -ErrorAction SilentlyContinue
|
||||
[System.Management.Automation.Internal.InternalTestHooks]::SetTestHook('ForcePromptForChoiceDefaultOption', $False)
|
||||
[System.Management.Automation.Internal.InternalTestHooks]::SetTestHook('ForcePromptForChoiceDefaultOption', $false)
|
||||
}
|
||||
|
||||
It "Should create Transcript file at default path" {
|
||||
|
||||
@@ -10,7 +10,7 @@ function CreateVHD ($VHDPath, $Size)
|
||||
Mount-VHD -Passthru | `
|
||||
get-disk -number {$_.DiskNumber} | `
|
||||
Initialize-Disk -PartitionStyle MBR -PassThru | `
|
||||
New-Partition -UseMaximumSize -AssignDriveLetter:$False -MbrType IFS | `
|
||||
New-Partition -UseMaximumSize -AssignDriveLetter:$false -MbrType IFS | `
|
||||
Format-Volume -Confirm:$false -FileSystem NTFS -force | `
|
||||
get-partition | `
|
||||
Add-PartitionAccessPath -AssignDriveLetter -PassThru | `
|
||||
|
||||
@@ -14,7 +14,7 @@ Describe 'Group policy settings tests' -Tag CI,RequireAdminOnWindows {
|
||||
AfterAll {
|
||||
$global:PSDefaultParameterValues = $originalDefaultParameterValues
|
||||
if ( $IsWindows ) {
|
||||
[System.Management.Automation.Internal.InternalTestHooks]::SetTestHook('BypassGroupPolicyCaching', $False)
|
||||
[System.Management.Automation.Internal.InternalTestHooks]::SetTestHook('BypassGroupPolicyCaching', $false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ Describe 'Group policy settings tests' -Tag CI,RequireAdminOnWindows {
|
||||
|
||||
Get-Alias $RareCommand -ErrorAction SilentlyContinue | Out-Null
|
||||
|
||||
(Get-Module $ModuleToLog).LogPipelineExecutionDetails = $False # turn off logging
|
||||
(Get-Module $ModuleToLog).LogPipelineExecutionDetails = $false # turn off logging
|
||||
Remove-ItemProperty -Path $KeyPath -Name EnableModuleLogging -Force # turn off GP setting
|
||||
Remove-item $ModuleNamesKeyPath -Recurse -Force
|
||||
# usually event becomes visible in the log after ~500 ms
|
||||
|
||||
@@ -37,7 +37,7 @@ function Wait-FileToBePresent
|
||||
|
||||
function Test-IsElevated
|
||||
{
|
||||
$IsElevated = $False
|
||||
$IsElevated = $false
|
||||
if ( $IsWindows ) {
|
||||
# on Windows we can determine whether we're executing in an
|
||||
# elevated context
|
||||
|
||||
Reference in New Issue
Block a user