Download PowerShell-master/test/xUnit/csharp/test_PowerShellAPI.cs from MegaBites-AI/Windows-powershell: direct link, hf CLI and curl.
- Browser
- Download file 817 Bytes
-
https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/xUnit/csharp/test_PowerShellAPI.cs
- Command line
-
hf download hf://datasets/MegaBites-AI/Windows-powershell/PowerShell-master/test/xUnit/csharp/test_PowerShellAPI.cs
-
curl -L -o test_PowerShellAPI.cs https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/xUnit/csharp/test_PowerShellAPI.cs
817 Bytes
| // Copyright (c) Microsoft Corporation. | |
| // Licensed under the MIT License. | |
| using System; | |
| using System.Management.Automation; | |
| using Xunit; | |
| namespace PSTests.Sequential | |
| { | |
| public static class PowerShellHostingScenario | |
| { | |
| [] | |
| 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); | |
| } | |
| } | |
| } | |
| } | |