initial
This commit is contained in:
commit
baa0056244
352 changed files with 47928 additions and 0 deletions
|
|
@ -0,0 +1,3 @@
|
|||
param($Param1, $Param2, [switch]$Force)
|
||||
|
||||
"args are $args"
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
$i = 1
|
||||
|
||||
while ($i -le 500000)
|
||||
{
|
||||
$str = "Output $i"
|
||||
Write-Host $str
|
||||
$i = $i + 1
|
||||
}
|
||||
|
||||
Write-Host "Done!"
|
||||
Get-Date
|
||||
Get-Host
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
$file = Get-ChildItem -Path "." | Select-Object -First 1
|
||||
Write-Host "Debug over"
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
$promptSawDebug = $false
|
||||
|
||||
function prompt {
|
||||
if (Test-Path variable:/PSDebugContext -ErrorAction SilentlyContinue) {
|
||||
$promptSawDebug = $true
|
||||
}
|
||||
|
||||
return "$promptSawDebug > "
|
||||
}
|
||||
|
||||
Write-Host "Debug over"
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
class MyClass {
|
||||
[String] $Name;
|
||||
[Int32] $Number; }
|
||||
[bool]$scriptBool = $false
|
||||
$scriptInt = 42
|
||||
function Test-Variables {
|
||||
$strVar = "Hello"
|
||||
[string]$strVar2 = "Hello2"
|
||||
$arrVar = @(1, 2, $strVar, $objVar)
|
||||
$assocArrVar = @{ firstChild = "Child"; secondChild = 42 }
|
||||
$classVar = [MyClass]::new();
|
||||
$classVar.Name = "Test"
|
||||
$classVar.Number = 42;
|
||||
$enumVar = $ErrorActionPreference
|
||||
$nullString = [NullString]::Value
|
||||
$psObjVar = New-Object -TypeName PSObject -Property @{Name = 'John'; Age = 75 }
|
||||
$psCustomObjVar = [PSCustomObject] @{Name = 'Paul'; Age = 73 }
|
||||
$procVar = Get-Process -PID $PID
|
||||
$trueVar = $true
|
||||
$falseVar = $false
|
||||
Write-Output "Done"
|
||||
}
|
||||
|
||||
Test-Variables
|
||||
# NOTE: If a line is added to the function above, the line numbers in the
|
||||
# associated unit tests MUST be adjusted accordingly.
|
||||
|
||||
$SCRIPT:simpleArray = @(
|
||||
1
|
||||
2
|
||||
'red'
|
||||
'blue'
|
||||
)
|
||||
|
||||
# This is a dummy function that the test will use to stop and evaluate the debug environment
|
||||
function __BreakDebuggerEnumerableShowsRawView{}; __BreakDebuggerEnumerableShowsRawView
|
||||
|
||||
$SCRIPT:simpleDictionary = @{
|
||||
item1 = 1
|
||||
item2 = 2
|
||||
item3 = 'red'
|
||||
item4 = 'blue'
|
||||
}
|
||||
function __BreakDebuggerDictionaryShowsRawView{}; __BreakDebuggerDictionaryShowsRawView
|
||||
|
||||
$SCRIPT:sortedDictionary = [Collections.Generic.SortedDictionary[string, object]]::new()
|
||||
$sortedDictionary[1] = 1
|
||||
$sortedDictionary[2] = 2
|
||||
$sortedDictionary['red'] = 'red'
|
||||
$sortedDictionary['blue'] = 'red'
|
||||
|
||||
# This is a dummy function that the test will use to stop and evaluate the debug environment
|
||||
function __BreakDebuggerDerivedDictionaryPropertyInRawView{}; __BreakDebuggerDerivedDictionaryPropertyInRawView
|
||||
|
||||
class CustomToString {
|
||||
[String]$String = 'Hello'
|
||||
[String]ToString() {
|
||||
return $this.String.ToUpper()
|
||||
}
|
||||
}
|
||||
$SCRIPT:CustomToStrings = 1..1000 | ForEach-Object {
|
||||
[CustomToString]::new()
|
||||
}
|
||||
|
||||
# This is a dummy function that the test will use to stop and evaluate the debug environment
|
||||
function __BreakDebuggerToStringShouldMarshallToPipeline{}; __BreakDebuggerToStringShouldMarshallToPipeline
|
||||
Loading…
Add table
Add a link
Reference in a new issue