forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_PowerShellAPI.cs
More file actions
24 lines (22 loc) · 817 Bytes
/
test_PowerShellAPI.cs
File metadata and controls
24 lines (22 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Management.Automation;
using Xunit;
namespace PSTests.Sequential
{
public static class PowerShellHostingScenario
{
[Fact]
public static void TestStartJobThrowTerminatingException()
{
using (var ps = PowerShell.Create())
{
ps.AddCommand("Start-Job").AddParameter("ScriptBlock", ScriptBlock.Create("1+1"));
var ex = Assert.Throws<CmdletInvocationException>(() => ps.Invoke());
Assert.IsType<PSNotSupportedException>(ex.InnerException);
Assert.Equal("IPCPwshExecutableNotFound,Microsoft.PowerShell.Commands.StartJobCommand", ex.ErrorRecord.FullyQualifiedErrorId);
}
}
}
}