forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasicEngine.Tests.ps1
More file actions
23 lines (20 loc) · 840 Bytes
/
BasicEngine.Tests.ps1
File metadata and controls
23 lines (20 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Describe 'Basic engine APIs' -Tags "CI" {
Context 'powershell::Create' {
It 'can create default instance' {
[powershell]::Create() | Should Not Be $null
}
It "can load the default snapin 'Microsoft.WSMan.Management'" -skip:(-not $IsWindows) {
$ps = [powershell]::Create()
$ps.AddScript("Get-Command -Name Test-WSMan") > $null
$result = $ps.Invoke()
$result.Count | Should Be 1
$result[0].Source | Should Be "Microsoft.WSMan.Management"
}
}
Context 'executioncontext' {
It 'args are passed correctly' {
$result = $ExecutionContext.SessionState.InvokeCommand.InvokeScript('"`$args:($args); `$input:($input)"', 1, 2, 3)
$result | Should BeExactly '$args:(1 2 3); $input:()'
}
}
}