/
githubmirror
/
PowerShell
Обзор
Документация
Войти
/
githubmirror
/
PowerShell
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/xUnit/csharp/test_PowerShellAPI.cs
24 строки
817 B
Steve Lee
Update copyright notice to latest guidance (#12190)
24 мар 2020, 21:08
Не верифицирован
24 мар 2020, 21:08
b7cb335
Код
Авторство
О чём код?
// 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); } } } }