public void get_wmi_win32_computersystem_object_and_compare_environment_machinename() { using (var Win32_ComputerSystem = HttpPowerShell.Invoke("Get-WmiObject Win32_ComputerSystem").AsDisposable()) { var wmi = Win32_ComputerSystem.First(); if (!string.Equals((string)wmi.ToDynamic().Name, Environment.MachineName, StringComparison.CurrentCultureIgnoreCase)) { Assert.Fail("The WMI::Win32_ComputerSystem.Name value is not equal to Environment.MachineName."); } } }
public void parameter_value_passed_to_script_via_input_is_returned_from_process_block() { var guid = Guid.NewGuid(); Assert.AreEqual <Guid>(guid, HttpPowerShell.Invoke <Guid>("process { $_ }", input: new[] { guid }).First()); }
public void parameter_value_passed_to_script_via_parameters_is_returned() { var guid = Guid.NewGuid(); Assert.AreEqual <Guid>(guid, HttpPowerShell.Invoke <Guid>("param($guid) $guid", parameters: new { guid = guid }).First()); }
public void should_throw_CmdletInvocationException_when_getcredential() { HttpPowerShell.Invoke("Get-Credential"); }